[Gllug] Clock( ) function in C

'lesleyb' lesleyb at herlug.org.uk
Tue Sep 20 16:48:21 UTC 2011


On Tue, Sep 20, 2011 at 03:43:16PM +0100, dudes dudes wrote:
> 
> 
> 
> Hi, 
> 
>  
> 
> Appreciate
> any inputs on this C. 
> 
>  
> 
> 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();
> 
>  
> 
>  
> 
> Any examples or similar approaches are highly appreciated. I have googled
> different resources but couldn’t find anything useful.
> 
>  
> 
> Thanks in
> advanceak
> 
> 
The alarm function allows you to send a signal into the calling process after
so many seconds ... so just use that and add a signal handler

Or use setitimer/getitimer and an appropriate signal handler.

Regards

Lesley
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list