May 01, 2003
Win32 Performance Measurement Options
Listing 6 Extract from winstl_processtimes_counter.h
/* /////////////////////////////////////////////////////////////
* ...
*
* Extract from winstl_processtimes_counter.h
*
* Copyright (C) 2002, Synesis Software Pty Ltd.
* (Licensed under the Synesis Software Standard Source License:
* http://www.synesis.com.au/licenses/ssssl.html)
*
* ...
* ////////////////////////////////////////////////////////// */
inline /* static */ HANDLE processtimes_counter::_get_process_handle()
{
static HANDLE s_hProcess = ::GetCurrentProcess();
return s_hProcess;
}
// Operations
inline void processtimes_counter::start()
{
FILETIME creationTime;
FILETIME exitTime;
::GetProcessTimes( _get_process_handle(),
&creationTime,
&exitTime,
reinterpret_cast<LPFILETIME>(&m_kernelStart),
reinterpret_cast<LPFILETIME>(&m_userStart));
}
inline void processtimes_counter::stop()
{
FILETIME creationTime;
FILETIME exitTime;
::GetProcessTimes( _get_process_handle(),
&creationTime,
&exitTime,
reinterpret_cast<LPFILETIME>(&m_kernelEnd),
reinterpret_cast<LPFILETIME>(&m_userEnd));
}
Previous Page |
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
Next Page