[Gllug] Clock( ) function in C

dudes dudes akam123 at hotmail.co.uk
Tue Sep 20 15:27:15 UTC 2011


thanks Tet, but is it possible to count for "about" 5 Milliseconds such as :

do{

keep printing hello world for "about" 5 Mil

while(clock( 5 mill))

thnx


> Date: Tue, 20 Sep 2011 15:49:51 +0100
> From: tethys at gmail.com
> To: gllug at gllug.org.uk
> Subject: Re: [Gllug] Clock( ) function in C
> 
> On Tue, Sep 20, 2011 at 3:43 PM, dudes dudes <akam123 at hotmail.co.uk> wrote:
> 
> > I’m trying to use clock() function (time.h) in milliseconds, but not CPU
> > based. For example do something (some codes) for 5 milliseconds and when it
> > is exactly 5 millisecond, then exit();
> 
> You can't do that with standard Linux. All you can do is say "this
> will run for at least 5 milliseconds". If you need precise accuracy,
> in that it must be *exactly* 5ms, you need to use one of the realtime
> Linux variants.
> 
> Tet
> 
> 
> -- 
> "Java is a DSL for taking large XML files and converting them to stack
> traces" -- Bulat Shakirzyanov
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110920/9090d7f3/attachment.html>
-------------- next part --------------
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list