[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] En ordentlig timing



On Thu, Nov 01, 2001 at 12:30:12PM +0100, Peter Aagaard Kristensen wrote:
>  >Under Linux er der f.eks. usleep, der sover med microsekund granularitet.
>  >(10-6 sekunder). Hvis det ikke er "småt nok", så må du lige skrive hvad
>  >dine tidsrum egentlig er - så kan vi bedre forholde os til det.
> usleep ligner godt nok noget der kan bruges. Men dens præcision er
> noget overvurderet (i hvert fald på min maskine).
> På min RH7.0 Athlon 500 er dens opløsning over 1 ms.
> På min Win2K Thunderbird 1100 er dens opløsning også omkring 1 ms.
> Så det korte af det lange er at den i hvert fald ikke kan bruges :-(
> 
> Er der en funktion til at læse tiden præcist for så kan jeg vel polle den.
Naar du skal have saa fin oploesning, er det letteste saa ikke bare at
lave busy-wait? Dvs. du koerer en eller anden loekke igennem, som ikke
rigtigt goer noget, og det timer du. Saa ved du hvor lang tid det tager
at koere den loekke igennem, og saa kan du brug det til at vente. Det
betyder selvfoelgeligt at systemet bliver foelsomt for hvad der ellers
koerer paa computeren sammen med braendingen, og at systemet bruger 100%
CPU tid imens du braender.

-- 
/-----------------------------------------------------\
| Klaus S. Madsen      | "Failure is not an option... |
| ICQ: 45400164        |  It comes bundled with your  |
| www.hjernemadsen.org |  Microsoft products!"        |
\-----------------------------------------------------/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *