Lines Matching refs:TimeDelta

24 TEST(TimeDelta, FromAndIn) {  in TEST()  argument
25 EXPECT_EQ(TimeDelta::FromDays(2), TimeDelta::FromHours(48)); in TEST()
26 EXPECT_EQ(TimeDelta::FromHours(3), TimeDelta::FromMinutes(180)); in TEST()
27 EXPECT_EQ(TimeDelta::FromMinutes(2), TimeDelta::FromSeconds(120)); in TEST()
28 EXPECT_EQ(TimeDelta::FromSeconds(2), TimeDelta::FromMilliseconds(2000)); in TEST()
29 EXPECT_EQ(TimeDelta::FromMilliseconds(2), TimeDelta::FromMicroseconds(2000)); in TEST()
30 EXPECT_EQ(static_cast<int>(13), TimeDelta::FromDays(13).InDays()); in TEST()
31 EXPECT_EQ(static_cast<int>(13), TimeDelta::FromHours(13).InHours()); in TEST()
32 EXPECT_EQ(static_cast<int>(13), TimeDelta::FromMinutes(13).InMinutes()); in TEST()
33 EXPECT_EQ(static_cast<int64_t>(13), TimeDelta::FromSeconds(13).InSeconds()); in TEST()
34 EXPECT_DOUBLE_EQ(13.0, TimeDelta::FromSeconds(13).InSecondsF()); in TEST()
36 TimeDelta::FromMilliseconds(13).InMilliseconds()); in TEST()
37 EXPECT_DOUBLE_EQ(13.0, TimeDelta::FromMilliseconds(13).InMillisecondsF()); in TEST()
39 TimeDelta::FromMicroseconds(13).InMicroseconds()); in TEST()
44 TEST(TimeDelta, MachTimespec) { in TEST() argument
45 TimeDelta null = TimeDelta(); in TEST()
46 EXPECT_EQ(null, TimeDelta::FromMachTimespec(null.ToMachTimespec())); in TEST()
47 TimeDelta delta1 = TimeDelta::FromMilliseconds(42); in TEST()
48 EXPECT_EQ(delta1, TimeDelta::FromMachTimespec(delta1.ToMachTimespec())); in TEST()
49 TimeDelta delta2 = TimeDelta::FromDays(42); in TEST()
50 EXPECT_EQ(delta2, TimeDelta::FromMachTimespec(delta2.ToMachTimespec())); in TEST()
116 static void ResolutionTest(T (*Now)(), TimeDelta target_granularity) { in ResolutionTest()
123 static const TimeDelta kExpirationTimeout = TimeDelta::FromSeconds(1); in ResolutionTest()
126 TimeDelta delta; in ResolutionTest()
147 static const TimeDelta kTargetGranularity = TimeDelta::FromMilliseconds(16); in TEST()
154 static const TimeDelta kTargetGranularity = TimeDelta::FromMilliseconds(16); in TEST()
163 static const TimeDelta kTargetGranularity = TimeDelta::FromMilliseconds(1); in TEST()
173 while (!timer.HasExpired(TimeDelta::FromMilliseconds(100))) { in TEST()