[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, 1 Nov 2001, Peter Aagaard Kristensen wrote:

> Hej CProg
> Jeg er i gang med at skrive en PIC brænder og sådan en skal times ordentligt.
> Den skal i teorien virke på både linux og windows, men til at starte med 
> skal jeg have noget op at køre på windows.
> Så vidt jeg ved er der ikke noget c++ stl der tager sig af præcis timing så 
> der skal nok skrives noget linux og windows specifik kode :-(
> Det jeg er ude efter er en måde at vente et stykke tid (ligesom sleep) men 
> det skal bare være meget mere præcist.
> Evt. kunne problemet løses ved at polle systemtiden(eller lignende) og se 
> hvornår der er gået det specifikke interval.
> Men igen skal det være meget præcist.
> Det er ikke vigtigt at det passer 100% men at jeg venter MINDST et vist 
> stykke tid. Derfor kunne sleep og diverse andre
> tidsfunktioner godt bruges, men da jeg skal gentage det 15.000 gange bliver 
> det alt for langsomt.

Øhm.

Du skriver at det skal være præcist, men at du kun skal "vente MINDST et
vist stykke tid". Så skriver du at antallet af iterationer gør at det er
for langsomt. Det er meget forvirrende.

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.

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
Unix is simple. It just takes a genius to understand its simplicity
                          
                                 - Dennis Ritchie



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