OT: C kerdes - delay (100) mennyi is?

HWSW Famulus hwsw at famulus.hu
Mon Sep 1 20:26:07 CEST 2003


Abban az ido szeletben amikor a sajat progi fut eppen....
Tapasztalatom alapjan lehet idoziteni/merni nagyon rovid idoket!

De, folyamatosan ismetlodo idozites csak >16 ms peridus idovel
tarthato nagyjabol pontosan.....
(10 ms es masik 10 ms ~ fele)

Kiveve, ha file muvelet is tortenik mert akkor az prioritast elvez
a user prg szinttel szemben ilynkor akar 200-300 ms is lehet
a kieso ido !

lehet novelni az prg prioritasat a feladatkezeloben, de
akkor meglassus a user interface a tobbi prg-nek :-)

KJ




----- Original Message ----- 
From: "Kondor Attila" <elektrolev at dpg.hu>
To: <elektro at tesla.hu>
Sent: Monday, September 01, 2003 7:12 PM
Subject: Re: OT: C kerdes - delay (100) mennyi is?


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