mirror of
https://github.com/cheat-engine/cheat-engine
synced 2026-08-15 02:26:08 -04:00
31 lines
No EOL
536 B
C++
31 lines
No EOL
536 B
C++
// UC_TIMER.H
|
|
|
|
#ifndef __UC_TIMER_H
|
|
#define __UC_TIMER_H
|
|
|
|
// import GetTickCount() (no of msec since begining of session)
|
|
#lib kernel32.dll
|
|
extern "C" {
|
|
__API unsigned long GetTickCount();
|
|
}
|
|
#lib
|
|
|
|
class Timer {
|
|
unsigned long m_start;
|
|
char* m_msg;
|
|
public:
|
|
Timer() { }
|
|
void start(char* msg) {
|
|
m_msg = msg;
|
|
m_start = GetTickCount();
|
|
}
|
|
void stop() {
|
|
unsigned long elapsed = GetTickCount() - m_start;
|
|
printf("%s: time %lf sec\n",m_msg,elapsed/1000.0);
|
|
}
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|