Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Apr 26, 2024
1 parent 554d3b3 commit 30c3036
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/karm-sys/tests/test-async-sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Async::Task<> sleepyBoy() {
auto start = Sys::now();
co_trya$(globalSched().sleepAsync(start + duration));
auto end = Sys::now();
auto delta = end - start;

logDebug("delta: {}", delta);

if (end - start < duration - TimeSpan::fromMSecs(10))
co_return Error::other("sleepAsync woke up too early");

if (end - start > duration + TimeSpan::fromMSecs(10))
co_return Error::other("sleepAsync woke up too late");

Expand Down

0 comments on commit 30c3036

Please sign in to comment.