precise time control under Windows
I ' m totally occupied recently ...:-(, I just can ' t spare out to type a word on the blog ...
For measuring the time accuratly, I wrote double classes and share it ...
Copy too much of the code from the codeproject.com, so I contribute some ... LOL
I am too busy ...
Stopwatch
Class Mmtimer;
Description:
The class stopwatch for measuring the duration accuratly, 1ms differency.
The class Mmtimer for triggering a callback function periodicly ...
Example:
1)
Stopwatch watch;
Watch. Start ();
..... your code to measure ...
Watch. Stop ();
Double duration = watch. Duration (); in milliseconds
2)
mmtimer<cdialog1> timer;
Timer. Start (Ten, this, &cdialog1::yourvoidproc);
...
Code:
StopwatchStopwatchM_nfrequencyQueryPerformanceFrequencyM_queryM_nfrequencyM_queryQuadPartStartStartQueryPerformanceCounterM_queryM_nprevcountM_queryQuadPartStopQueryPerformanceCounterM_queryM_ncurrcountM_queryQuadPartDurationM_nfrequencyM_ncurrcountM_nprevcountM_nfrequency__int64 m_nfrequency__int64 M_nprevcount__int64 M_ncurrcountLarge_integer M_queryTMmtimerTCallbackprocMmtimerM_nresolutionM_ntimeridNullM_lpcallfromNullTimecaps TCTimegetdevcapsTcTimecapsTimerr_noerrorM_nresolutionTcWperiodminTimebeginperiodM_nresolutionStartNdelayTLpcallfromCallbackproc LpcallbackprocM_lpcallfromLpcallfromM_callbackLpcallbackprocM_ntimeridtimeSetEventNdelayM_nresolutionCallbackDword_ptrTime_periodicM_ntimeridNullStopM_ntimeridMmresult resultTimekilleventM_ntimeridResultTimerr_noerrorM_ntimeridResultTimerr_noerrorMmtimerStopM_nresolutionTimeendperiodM_nresolutionCALLBACK CALLBACKUINT UtimeridUINT umsgDword_ptr DwuserDword_ptr DW1Dword_ptr DW2MmtimerTLptimerMmtimerTDwuserLptimerM_lpcallfromLptimerM_callbackCallbackproc M_callbackTM_lpcallfromM_nresolutionM_ntimerid