Re: Regarding time resolution in microsecond



"Rajat" <Rajat@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D46DF74C-CF0D-41D5-A4F1-759F25AAD682@xxxxxxxxxxxxxxxx
> Hi All,
>
> Could any body point out, how to get time in microsecond precision. As if
we
> use, timeBeginPeriod(1) also it will provide a resolution of 1
milisecond(or
> 1000 microsecond). Is there any way to get this resolution of 1
microsecond,
> or atleast
> 20 microsecond.
>
> Any pointer will be help full.
>
> Thanks in advance.

QueryPerformanceCounter often gives sub-microsecond accuracies. You need to
call QueryPerformanceFrequency to get the exact value of the timing
interval. Start at
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/timers/timerreference/timerfunctions/queryperformancecounter.asp

If your interest is in timing of code, then look at "How To Use
QueryPerformanceCounter to Time Code" at
http://support.microsoft.com/kb/q172338/

or "How To: Time Managed Code Using QueryPerformanceCounter and
QueryPerformanceFrequency" at
http://msdn.microsoft.com/library/en-us/dnpag/html/ScaleNetHowTo09.asp

Mike


.



Relevant Pages

  • Re: QueryPerformanceCounter
    ... Windows is not a real-time system, ... cannot operate on a microsecond level. ... QueryPerformanceCounter reads the PIT interval ... actually take multiple microseconds to run. ...
    (microsoft.public.vc.language)
  • Re: how do I know how long my function call took?
    ... experiment and we would like to know how much time the calling function takes. ... The specs say this should happen on the order of a microsecond, which is faster than we need. ... I have tried looking at the C FAQ and Google to find something that would give me better resolution, ... It's also worth asking one of the windows programming newsgroups. ...
    (comp.lang.c.moderated)
  • Re: timing VBA execution
    ... Not sure 10 milliseconds is enough resolution, ... > OSAX is Open Scripting Architecture eXtension - also called a Scripting ... > Since the PowerPC has a microsecond timer available, ...
    (microsoft.public.mac.office.excel)
  • Re: now.ticks does not work
    ... Willie. ... that can change the outcome of the timing. ... > | i will check out your QueryPerformanceCounter ... > |> Tickcount has a resolution of microseconds. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: now.ticks does not work
    ... Willie, ... that can change the outcome of the timing. ... | i will check out your QueryPerformanceCounter ... |> QueryPerformanceCounter has a resolution of nanoseconds or smaller (its ...
    (microsoft.public.dotnet.languages.vb)