mirror of
https://github.com/gosticks/RIOT.git
synced 2026-10-04 06:47:06 +00:00
tests: cpp11_condition_variable: vtimer to xtimer
This commit is contained in:
@@ -98,9 +98,9 @@ int main() {
|
||||
condition_variable cv;
|
||||
timex_t before, after;
|
||||
unique_lock<mutex> lk(m);
|
||||
vtimer_now(&before);
|
||||
xtimer_now_timex(&before);
|
||||
cv.wait_for(lk, chrono::seconds(timeout));
|
||||
vtimer_now(&after);
|
||||
xtimer_now_timex(&after);
|
||||
auto diff = timex_sub(after, before);
|
||||
assert(diff.seconds >= timeout);
|
||||
}
|
||||
@@ -114,10 +114,10 @@ int main() {
|
||||
condition_variable cv;
|
||||
timex_t before, after;
|
||||
unique_lock<mutex> lk(m);
|
||||
vtimer_now(&before);
|
||||
xtimer_now_timex(&before);
|
||||
auto time = riot::now() += chrono::seconds(timeout);
|
||||
cv.wait_until(lk, time);
|
||||
vtimer_now(&after);
|
||||
xtimer_now_timex(&after);
|
||||
auto diff = timex_sub(after, before);
|
||||
assert(diff.seconds >= timeout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user