Permalink
Browse files

Merge pull request #193 from kgksoft/master

"System sleep(s)" not worked properly for s >= 1 second
  • Loading branch information...
2 parents 6349b4e + 598b830 commit 5b4898363f254cb8d554fbc1c200c8b8b46f6c03 @stevedekorte committed Mar 13, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 libs/iovm/source/IoSystem.c
@@ -478,6 +478,11 @@ IO_METHOD(IoObject, sleep)
double seconds = IoMessage_locals_doubleArgAt_(m, locals, 0);
unsigned int microseconds = (seconds * 1000000);
+ while (microseconds > 999999)
+ {
+ usleep(999999);
+ microseconds -= 999999;
+ }
usleep(microseconds);
return self;
}

0 comments on commit 5b48983

Please sign in to comment.