#include <Measure.hpp>
Public Methods | |
Measure () | |
void | setClockPeriod (ULONG nsec=Period_1_ms) |
__inline _uint64 | getCycles () |
__inline double | getCPUfreq () |
__inline ULONG | getClockPeriod () |
__inline double | start () |
__inline double | stop () |
__inline double | getElapsed () |
__inline void | print () |
Measure (const Measure &src) | |
const Measure & | operator= (const Measure &src) |
Static Public Attributes | |
const ULONG | Period_1_ms = 1000000L |
const ULONG | Period_10_ms = 10000000L |
const ULONG | Period_100_ms = 100000000L |
Static Protected Attributes | |
double | cpu_freq = 0.00f |
ULONG | clock_period = Period_1_ms |
Private Attributes | |
double | elapsed |
_uint64 | start_time |
_uint64 | stop_time |
_clockperiod | clkper |
|
Definition at line 15 of file Measure.cpp. 00016 : elapsed( 0.0f ), start_time( 0ull ), stop_time( 0ull ) 00017 { 00018 00019 // Get the CPU frequency in order to do a precide time calculation 00020 cpu_freq = SYSPAGE_ENTRY( qtime )->cycles_per_sec; 00021 00022 setClockPeriod(); 00023 } |
|
Definition at line 43 of file Measure.inl. 00044 : elapsed( src.elapsed ), 00045 start_time( src.start_time ), stop_time( src.stop_time ) { } |
|
Definition at line 9 of file Measure.inl. 00010 { 00011 return cpu_freq; 00012 } |
|
Definition at line 14 of file Measure.inl. 00015 { 00016 return clock_period; 00017 } |
|
Definition at line 4 of file Measure.inl. 00005 { 00006 return ClockCycles(); 00007 } |
|
Definition at line 32 of file Measure.inl. 00033 { 00034 elapsed = ( stop_time - start_time ) / cpu_freq; 00035 return elapsed; 00036 } |
|
Definition at line 47 of file Measure.inl. 00048 { 00049 elapsed = src.elapsed; 00050 start_time = src.start_time; 00051 stop_time = src.stop_time; 00052 } |
|
Definition at line 38 of file Measure.inl. 00039 { 00040 printf( "%6.4f ms", elapsed * Period_1_ms ); 00041 } |
|
Definition at line 25 of file Measure.cpp. 00026 { 00027 // Set the system clock period to 1 ms, 00028 // a frequency that works with any 40 MHz or higher speed 00029 // processor, including the low speed Elan-104 boards running at 66 MHz 00030 // and the blazing fast Pentium III. 00031 00032 clock_period = nsec; 00033 00034 // There is only two data member in clkper: 00035 clkper.nsec = nsec; 00036 clkper.fract = 0; 00037 ClockPeriod( CLOCK_REALTIME, &clkper, NULL, 0 ); // 1 ms 00038 } |
|
Definition at line 19 of file Measure.inl. 00020 { 00021 start_time = ClockCycles(); 00022 return ( start_time / cpu_freq ); 00023 } |
|
Definition at line 25 of file Measure.inl. 00026 { 00027 stop_time = ClockCycles(); 00028 return ( stop_time / cpu_freq ); 00029 } |
|
Definition at line 10 of file Measure.cpp. |
|
Definition at line 9 of file Measure.cpp. |
|
Definition at line 8 of file Measure.cpp. |
|
Definition at line 45 of file Measure.hpp. |
|
Definition at line 13 of file Measure.cpp. |
|
Definition at line 12 of file Measure.cpp. |
|
Definition at line 40 of file Measure.hpp. Referenced by operator=().
|
|
Definition at line 42 of file Measure.hpp. Referenced by operator=().
|
|
Definition at line 43 of file Measure.hpp. Referenced by operator=().
|