[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



>Ikke når dit interval er 100ns. Det hjælper ikke at gettimeofday() er
>præcist hvis det tager 2us at udføre, vel?
Hvis vi ser bort fra kontekst skift kan det vel være ligemeget.
Antager vi at min busywait kode tager f.eks 10 ns(for at vælge noget nyt).
Jeg måler tiden, udfører 100 millioner busy waits, og måler tiden igen.
Så har jeg altså hvor lang tid det tog at udføre 100 millioner busy waits.
Hvis fejlen ved at kalde gettimeofday() er f.eks. 5 us er den samlede
målte tidsforskel 100 millioner * 10 ns + 2 * 5us = 1.00001s. Ergo 10.0001 ns pr. busy wait.
Jeg skal vente i 100 ns => cirka 10 busy waits. Det er da meget præcist.


- Peter




 
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] *