"Jacob Read" <23*7*9*
6@s*u*e*t*u*a*e*u*a*> wrote:
> ... if it's trying to sleep for less than the time it takes to switch states, at which point I assume it would immediately wake up upon moving to sleeping.
Yes, and it's realistic, too. From
man 3 sleep
- "System activity may lengthen the sleep by an indeterminate amount."
> For the integer thing, it's more the problem that when waiting for IO, due to the speeds and amounts of data, it becomes a double upon dividing, if divided correctly. But it the system time has to be an integer, then I'd have to consistently round up. Which means I wouldn't have to use doubles. My approach doesn't move through time by one microsecond at each point, and instead just skips to the next time. This is why this is more of a problem.
You can perform arithmetic in 'doubles' without requiring double variables or managing time with doubles. In the case of finding the next highest integer, you can use the standard
ceil()
function.