mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibCore: Add System::sleep_ms
This commit is contained in:
parent
e6e233fd64
commit
a291a7f770
Notes:
github-actions[bot]
2025-02-06 22:17:55 +00:00
Author: https://github.com/stasoid
Commit: a291a7f770
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2917
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 14 additions and 0 deletions
|
@ -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 {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue