blob: 4ef95e4323aea9b234993a433a07932bdfdb5c13 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <library/cpp/testing/unittest/registar.h>
#include "base.h"
#include "process_uptime.h"
#include "uptime.h"
Y_UNIT_TEST_SUITE(TestProcessUptimeSuite) {
Y_UNIT_TEST(TestProcessUptime) {
auto t0 = Uptime();
auto t1 = ProcessUptime();
UNIT_ASSERT(t1 < TDuration::Minutes(30));
UNIT_ASSERT(t0 > t1);
Sleep(TDuration::MilliSeconds(50)); // typical uptime resolution is 10-16 ms
auto t2 = ProcessUptime();
UNIT_ASSERT(t2 >= t1);
}
}
|