mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibCore: Add System::sleep_ms
This commit is contained in:
@@ -1010,4 +1010,11 @@ bool is_socket(int fd)
|
||||
return !result.is_error() && S_ISSOCK(result.value().st_mode);
|
||||
}
|
||||
|
||||
ErrorOr<void> sleep_ms(u32 milliseconds)
|
||||
{
|
||||
if (usleep(1000 * milliseconds) != 0)
|
||||
return Error::from_syscall("usleep"sv, -errno);
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user