Browse Source

tests: cpp11_thread: vtimer to xtimer

cc430
Cenk Gündoğan 7 years ago
parent
commit
bc12c7a69a
  1. 2
      tests/cpp11_thread/Makefile
  2. 8
      tests/cpp11_thread/main.cpp

2
tests/cpp11_thread/Makefile

@ -28,7 +28,7 @@ QUIET ?= 1
CXXEXFLAGS += -std=c++11
USEMODULE += cpp11-compat
USEMODULE += vtimer
USEMODULE += xtimer
USEMODULE += timex
include $(RIOTBASE)/Makefile.include

8
tests/cpp11_thread/main.cpp

@ -122,9 +122,9 @@ int main() {
puts("Testing sleep_for ...");
{
timex_t before, after;
vtimer_now(&before);
xtimer_now_timex(&before);
this_thread::sleep_for(chrono::seconds(1));
vtimer_now(&after);
xtimer_now_timex(&after);
auto diff = timex_sub(after, before);
assert(diff.seconds >= 1);
}
@ -135,9 +135,9 @@ int main() {
puts("Testing sleep_until ...");
{
timex_t before, after;
vtimer_now(&before);
xtimer_now_timex(&before);
this_thread::sleep_until(riot::now() += chrono::seconds(1));
vtimer_now(&after);
xtimer_now_timex(&after);
auto diff = timex_sub(after, before);
assert(diff.seconds >= 1);
}

Loading…
Cancel
Save