OT: C kerdes - delay (100) mennyi is?
Kondor Attila
elektrolev at dpg.hu
Mon Sep 1 19:12:16 CEST 2003
tiszaii <tiszaii at axelero.hu> 2003.09.01. 12:04:27 +2h-kor írta:
> >
> >
> >C nylvben a Delay az standard utasitas? Miben merik ms-ben?
> >delay (100); uatsitas 0.1s var?
> >
>
> Ilyen C standard nincs.
> Windowsban Sleep(100), millisecundumban , unixban,Linuxban sleep(100);
> pl. a pontos mérésnél nanosecundum, igy a Winben:
> QueryPerformanceCounter(..).
> Más C-ben meg te irod a delay fg.-t.
> üdv.
> TI
A Win32 Programmer's Reference szerint:
Counters and ellepsed times
By calling this function at the beginning and end of a section of code,
an application essentially uses the counter as a stopwatch.
For example, QueryPerformanceFrequency might indicate that the frequency
of the high-resolution performance counter on the system is 50,000 counts per
second.
If the application calls QueryPerformanceCounter immediately before and
immediately after
the section of code to be timed, the counter values might be 1500 counts and
3500 counts,
respectively.
These values would indicate that .04 seconds (2000 counts) elapsed while the
code executed.
Kondor Attila
--
More information about the Elektro
mailing list