Re: clock() - Does it work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Somebody in the thread at some point said:
> Hi,
> 
> I have an animation program that uses the clock() function
> for synchronization. It works fine with MinGW 3.2, but not with gcc
> 4.1.2 (FC6).
> 
> In the later case, clock() always return 0. I saw some people pointing

clock() is telling you about how much CPU time your process has eaten.

It sounds like you want to use select() with empty sets for the file
descriptors and a timeout that reflects how long you wanted to sleep.

You can use gettimeofday() like you already are to work out how long you
want to sleep.

-Andy


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux