uptime_ut.cpp 357 B

123456789101112
  1. #include <library/cpp/testing/unittest/registar.h>
  2. #include "uptime.h"
  3. Y_UNIT_TEST_SUITE(TestUptimeSuite) {
  4. Y_UNIT_TEST(TestUptime) {
  5. auto t1 = Uptime();
  6. Sleep(TDuration::MilliSeconds(50)); // typical uptime resolution is 10-16 ms
  7. auto t2 = Uptime();
  8. UNIT_ASSERT(t2 > t1);
  9. }
  10. } // Y_UNIT_TEST_SUITE(TestUptimeSuite)