Re: [LIP] usleep(): Not sleeping.

H S Rai <[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <[email protected]>
Today at 4:19pm +0530 Arun Venkataswamy wrote:

>   If your timing requirement is not very precise and if you don't
>   mind wasting processor cycles,

Though at present it is not so, but as a programmer I would like to
use efficient function.

If usleep() is there, then it should work. I want to know, if I am
unable to use it or there is really some problem with function.

>   while ((float)(c2-c1)/CLOCKS_PER_SEC < delaytime) c2 = clock();
>   
>   'delaytime' is a float and it represents 'seconds' and not
>   'milliseconds'

I believe we need to multiply (c2-c1) by 10000 to get in secs.

Thanks for your reply.

Still I wait for comments on "usleep()" or some better alternative.
In the mean time I will use your above technique.

With kind regards,

-- 
H.S.Rai    http://www.grex.org/~hsrai | Registered Linux User # 223684
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=223684

:
####[ GNU/Linux One Stanza Tip (LOST) ]#######################

Sub : Tracking files changed in last 24 hrs          LOST #364

To track all files that have been modified in last 24 hours,
(a security related issue), as root do:
#find / -mtime 1 -o -ctime 1

####[vivekachary (at) yahoo.com]##############################
:



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.