Add a Sleep() function.

llvm-svn: 64101
This commit is contained in:
Mikhail Glushenkov 2009-02-08 22:47:39 +00:00
parent c3f02abe2b
commit d9f64e601f
3 changed files with 18 additions and 5 deletions

View File

@ -39,6 +39,11 @@ namespace sys {
/// @returns -1=cancelled, 0=untriggered, 1=triggered
int AlarmStatus();
/// Sleep for n seconds.
/// @returns nothing.
void Sleep(unsigned n);
} // End sys namespace
} // End llvm namespace

View File

@ -66,3 +66,7 @@ int sys::AlarmStatus() {
return 1;
return 0;
}
void Sleep(unsigned n) {
::sleep(n);
}

View File

@ -34,3 +34,7 @@ int sys::AlarmStatus() {
// FIXME: Implement for Win32
return 0;
}
void Sleep(unsigned n) {
Sleep(n*1000);
}