Precise time control under Windows

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.