/system/libfmq/benchmarks/ |
D | msgq_benchmark_client.cpp | 127 std::chrono::time_point<std::chrono::high_resolution_clock> timeStart = in TEST_F() 128 std::chrono::high_resolution_clock::now(); in TEST_F() 138 std::chrono::time_point<std::chrono::high_resolution_clock> timeEnd = in TEST_F() 139 std::chrono::high_resolution_clock::now(); in TEST_F() 140 accumulatedTime += static_cast<int64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>( in TEST_F() 161 std::chrono::time_point<std::chrono::high_resolution_clock> timeStart = in TEST_F() 162 std::chrono::high_resolution_clock::now(); in TEST_F() 171 std::chrono::time_point<std::chrono::high_resolution_clock> timeEnd = in TEST_F() 172 std::chrono::high_resolution_clock::now(); in TEST_F() 195 std::chrono::time_point<std::chrono::high_resolution_clock> timeStart = in TEST_F() [all …]
|
/system/bt/common/test/ |
D | thread_performance_test.cc | 121 std::chrono::steady_clock::time_point start_time = in TEST_F() 122 std::chrono::steady_clock::now(); in TEST_F() 131 std::chrono::steady_clock::time_point end_time = in TEST_F() 132 std::chrono::steady_clock::now(); in TEST_F() 133 std::chrono::milliseconds duration = in TEST_F() 134 std::chrono::duration_cast<std::chrono::milliseconds>(end_time - in TEST_F() 166 std::chrono::steady_clock::time_point start_time = in TEST_F() 167 std::chrono::steady_clock::now(); in TEST_F() 176 std::chrono::steady_clock::time_point end_time = in TEST_F() 177 std::chrono::steady_clock::now(); in TEST_F() [all …]
|
/system/core/fs_mgr/ |
D | file_wait.cpp | 41 bool PollForFile(const std::string& path, const std::chrono::milliseconds relative_timeout) { in PollForFile() 42 auto start_time = std::chrono::steady_clock::now(); in PollForFile() 49 auto now = std::chrono::steady_clock::now(); in PollForFile() 50 auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time); in PollForFile() 55 bool PollForFileDeleted(const std::string& path, const std::chrono::milliseconds relative_timeout) { in PollForFileDeleted() 56 auto start_time = std::chrono::steady_clock::now(); in PollForFileDeleted() 63 auto now = std::chrono::steady_clock::now(); in PollForFileDeleted() 64 auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time); in PollForFileDeleted() 73 const std::chrono::milliseconds relative_timeout); 88 std::chrono::time_point<std::chrono::steady_clock> start_time_; [all …]
|
/system/core/llkd/include/ |
D | llkd.h | 77 std::chrono::milliseconds llkCheck(bool checkRunning = false); 80 #define LLK_TIMEOUT_MS_DEFAULT std::chrono::duration_cast<milliseconds>(std::chrono::minutes(10)) 81 #define LLK_TIMEOUT_MS_MINIMUM std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::… 82 #define LLK_CHECK_MS_MINIMUM std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::…
|
/system/bt/gd/os/linux_generic/ |
D | alarm_unittest.cc | 58 auto before = std::chrono::steady_clock::now(); in TEST_F() 62 …BindOnce(&std::promise<void>::set_value, common::Unretained(&promise)), std::chrono::milliseconds(… in TEST_F() 64 auto after = std::chrono::steady_clock::now(); in TEST_F() 65 auto duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(after - before); in TEST_F() 70 …alarm_->Schedule(BindOnce([]() { ASSERT_TRUE(false) << "Should not happen"; }), std::chrono::milli… in TEST_F() 72 std::this_thread::sleep_for(std::chrono::milliseconds(5)); in TEST_F() 76 …alarm_->Schedule(BindOnce(&Alarm::Cancel, common::Unretained(alarm_)), std::chrono::milliseconds(1… in TEST_F() 77 std::this_thread::sleep_for(std::chrono::milliseconds(5)); in TEST_F() 81 …alarm_->Schedule(BindOnce([]() { ASSERT_TRUE(false) << "Should not happen"; }), std::chrono::milli… in TEST_F() 85 …BindOnce(&std::promise<void>::set_value, common::Unretained(&promise)), std::chrono::milliseconds(… in TEST_F() [all …]
|
D | repeating_alarm_unittest.cc | 48 auto start_time = std::chrono::steady_clock::now(); in VerifyMultipleDelayedTasks() 60 std::chrono::milliseconds(interval_between_tasks_ms)); in VerifyMultipleDelayedTasks() 67 std::chrono::steady_clock::time_point start_time, in verify_delayed_tasks() 73 auto time_now = std::chrono::steady_clock::now(); in verify_delayed_tasks() 79 std::this_thread::sleep_for(std::chrono::milliseconds(task_length_ms)); in verify_delayed_tasks() 98 auto before = std::chrono::steady_clock::now(); in TEST_F() 101 …common::Bind(&std::promise<void>::set_value, common::Unretained(&promise)), std::chrono::milliseco… in TEST_F() 104 auto after = std::chrono::steady_clock::now(); in TEST_F() 110 alarm_->Schedule(should_not_happen_, std::chrono::milliseconds(10)); in TEST_F() 112 std::this_thread::sleep_for(std::chrono::milliseconds(50)); in TEST_F() [all …]
|
/system/extras/libperfmgr/tests/ |
D | RequestGroupTest.cc | 29 constexpr double kTIMING_TOLERANCE_MS = std::chrono::milliseconds(25).count(); 41 auto start = std::chrono::steady_clock::now(); in TEST() 47 std::chrono::milliseconds expire_time; in TEST() 60 std::chrono::milliseconds expire_time; in TEST() 62 auto expect = std::chrono::duration_cast<std::chrono::milliseconds>( in TEST() 63 ReqTime::max() - std::chrono::steady_clock::now()); in TEST() 73 auto start = std::chrono::steady_clock::now(); in TEST() 80 std::chrono::milliseconds expire_time; in TEST() 82 EXPECT_EQ(std::chrono::milliseconds::max(), expire_time); in TEST() 89 auto start = std::chrono::steady_clock::now(); in TEST() [all …]
|
D | FileNodeTest.cc | 32 constexpr double kTIMING_TOLERANCE_MS = std::chrono::milliseconds(25).count(); 112 auto start = std::chrono::steady_clock::now(); in TEST() 114 std::chrono::milliseconds expire_time = t.Update(true); in TEST() 116 EXPECT_NEAR(std::chrono::milliseconds(200).count(), expire_time.count(), in TEST() 122 EXPECT_NEAR(std::chrono::milliseconds(500).count(), expire_time.count(), in TEST() 130 auto start = std::chrono::steady_clock::now(); in TEST() 132 std::chrono::milliseconds expire_time = t.Update(true); in TEST() 135 EXPECT_NEAR(std::chrono::milliseconds(500).count(), expire_time.count(), in TEST() 141 EXPECT_NEAR(std::chrono::milliseconds(200).count(), expire_time.count(), in TEST() 147 EXPECT_NEAR(std::chrono::milliseconds(300).count(), expire_time.count(), in TEST() [all …]
|
D | PropertyNodeTest.cc | 33 constexpr double kTIMING_TOLERANCE_MS = std::chrono::milliseconds(25).count(); 120 auto start = std::chrono::steady_clock::now(); in TEST() 122 std::chrono::milliseconds expire_time = t.Update(true); in TEST() 125 EXPECT_NEAR(std::chrono::milliseconds(500).count(), expire_time.count(), in TEST() 131 EXPECT_NEAR(std::chrono::milliseconds(200).count(), expire_time.count(), in TEST() 137 EXPECT_NEAR(std::chrono::milliseconds(300).count(), expire_time.count(), in TEST() 143 EXPECT_EQ(std::chrono::milliseconds::max(), expire_time); in TEST() 150 auto start = std::chrono::steady_clock::now(); in TEST() 152 std::chrono::milliseconds expire_time = t.Update(true); in TEST() 155 EXPECT_NEAR(std::chrono::milliseconds(500).count(), expire_time.count(), in TEST() [all …]
|
/system/netd/server/ |
D | Process.cpp | 57 const std::chrono::steady_clock::time_point sStartTime = std::chrono::steady_clock::now(); 59 std::chrono::milliseconds totalRunningTime() { in totalRunningTime() 60 return std::chrono::duration_cast<std::chrono::milliseconds>( in totalRunningTime() 61 std::chrono::steady_clock::now() - sStartTime); in totalRunningTime() 64 std::string formatDuration(std::chrono::milliseconds duration) { in formatDuration() 65 auto hrs = std::chrono::duration_cast<std::chrono::hours>(duration); in formatDuration() 67 const auto mins = std::chrono::duration_cast<std::chrono::minutes>(duration); in formatDuration() 69 const auto secs = std::chrono::duration_cast<std::chrono::seconds>(duration); in formatDuration() 74 hrs -= std::chrono::hours(days * 24); in formatDuration()
|
/system/libbase/ |
D | chrono_utils_test.cpp | 31 std::chrono::seconds GetBootTimeSeconds() { in GetBootTimeSeconds() 35 auto now_tp = boot_clock::time_point(std::chrono::seconds(now.tv_sec) + in GetBootTimeSeconds() 36 std::chrono::nanoseconds(now.tv_nsec)); in GetBootTimeSeconds() 37 return std::chrono::duration_cast<std::chrono::seconds>(now_tp.time_since_epoch()); in GetBootTimeSeconds() 44 std::chrono::duration_cast<std::chrono::seconds>(boot_clock::now().time_since_epoch()); in TEST() 63 auto expected = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start); in TEST()
|
D | properties.cpp | 155 static void DurationToTimeSpec(timespec& ts, const std::chrono::milliseconds d) { in DurationToTimeSpec() 156 auto s = std::chrono::duration_cast<std::chrono::seconds>(d); in DurationToTimeSpec() 157 auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(d - s); in DurationToTimeSpec() 158 ts.tv_sec = std::min<std::chrono::seconds::rep>(s.count(), std::numeric_limits<time_t>::max()); in DurationToTimeSpec() 162 using AbsTime = std::chrono::time_point<std::chrono::steady_clock>; 164 static void UpdateTimeSpec(timespec& ts, std::chrono::milliseconds relative_timeout, in UpdateTimeSpec() 166 auto now = std::chrono::steady_clock::now(); in UpdateTimeSpec() 167 auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time); in UpdateTimeSpec() 181 const std::chrono::milliseconds& relative_timeout, in WaitForPropertyCreation() 197 std::chrono::milliseconds relative_timeout) { in WaitForProperty() [all …]
|
/system/extras/simpleperf/ |
D | cpu_hotplug_test.cpp | 40 static auto test_duration_for_long_tests = std::chrono::seconds(120); 41 static auto cpu_hotplug_interval = std::chrono::microseconds(1000); 72 std::this_thread::sleep_for(std::chrono::milliseconds(500)); in DisableMpdecision() 78 std::this_thread::sleep_for(std::chrono::milliseconds(500)); in EnableMpdecision() 144 std::this_thread::sleep_for(std::chrono::milliseconds(1)); in SetCpuOnline() 243 auto start_time = std::chrono::steady_clock::now(); in TEST() 245 auto end_time = std::chrono::steady_clock::now() + test_duration_for_long_tests; in TEST() 246 auto report_step = std::chrono::seconds(15); in TEST() 250 if (cur_time + report_step < std::chrono::steady_clock::now()) { in TEST() 252 auto diff = std::chrono::duration_cast<std::chrono::seconds>( in TEST() [all …]
|
/system/bt/gd/os/ |
D | alarm_benchmark.cc | 60 auto end_time = std::chrono::steady_clock::now(); in AlarmSleepAndCountDelayedTime() 61 …auto duration_since_start = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start… in AlarmSleepAndCountDelayedTime() 64 std::this_thread::sleep_for(std::chrono::milliseconds(task_length_)); in AlarmSleepAndCountDelayedTime() 80 std::chrono::time_point<std::chrono::steady_clock> start_time_; 90 auto start_time_point = std::chrono::steady_clock::now(); in BENCHMARK_DEFINE_F() 93 std::chrono::milliseconds(milliseconds)); in BENCHMARK_DEFINE_F() 95 auto end_time_point = std::chrono::steady_clock::now(); in BENCHMARK_DEFINE_F() 96 …auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(end_time_point - start_time_p… in BENCHMARK_DEFINE_F() 118 start_time_ = std::chrono::steady_clock::now(); in BENCHMARK_DEFINE_F() 123 std::chrono::milliseconds(task_interval_)); in BENCHMARK_DEFINE_F()
|
/system/core/fs_mgr/libdm/ |
D | utility.cpp | 30 const std::chrono::milliseconds& timeout_ms) { in WaitForCondition() 31 auto start_time = std::chrono::steady_clock::now(); in WaitForCondition() 39 auto now = std::chrono::steady_clock::now(); in WaitForCondition() 40 auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time); in WaitForCondition() 45 bool WaitForFile(const std::string& path, const std::chrono::milliseconds& timeout_ms) { in WaitForFile() 61 bool WaitForFileDeleted(const std::string& path, const std::chrono::milliseconds& timeout_ms) { in WaitForFileDeleted()
|
D | loop_control.cpp | 42 bool LoopControl::Attach(int file_fd, const std::chrono::milliseconds& timeout_ms, in Attach() 44 auto start_time = std::chrono::steady_clock::now(); in Attach() 51 auto now = std::chrono::steady_clock::now(); in Attach() 52 auto time_elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(now - start_time); in Attach() 136 LoopDevice::LoopDevice(android::base::borrowed_fd fd, const std::chrono::milliseconds& timeout_ms, in LoopDevice() 145 LoopDevice::LoopDevice(const std::string& path, const std::chrono::milliseconds& timeout_ms) in LoopDevice() 162 void LoopDevice::Init(const std::chrono::milliseconds& timeout_ms) { in Init()
|
/system/netd/libnetdutils/ |
D | BackoffSequenceTest.cpp | 133 auto backoff = BackoffSequence<std::chrono::seconds>::Builder() in TEST() 134 .withInitialRetransmissionTime(std::chrono::seconds(0)) in TEST() 145 auto backoff = BackoffSequence<std::chrono::milliseconds>::Builder() in TEST() 146 .withInitialRetransmissionTime(std::chrono::milliseconds(5)) in TEST() 147 .withMaximumRetransmissionDuration(std::chrono::milliseconds(3)) in TEST() 150 EXPECT_EQ(std::chrono::milliseconds(3), backoff.getNextTimeout()); in TEST() 158 auto backoff = BackoffSequence<std::chrono::hours>::Builder() in TEST() 159 .withInitialRetransmissionTime(std::chrono::hours(5)) in TEST() 160 .withMaximumRetransmissionDuration(std::chrono::hours(5)) in TEST() 163 EXPECT_EQ(std::chrono::hours(5), backoff.getNextTimeout()); in TEST() [all …]
|
/system/extras/libperfmgr/ |
D | RequestGroup.cc | 44 bool RequestGroup::GetExpireTime(std::chrono::milliseconds* expire_time) { in GetExpireTime() 45 ReqTime now = std::chrono::steady_clock::now(); in GetExpireTime() 46 *expire_time = std::chrono::milliseconds::max(); in GetExpireTime() 50 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>( in GetExpireTime() 52 if (duration <= std::chrono::milliseconds::zero()) { in GetExpireTime()
|
/system/libbase/include/android-base/ |
D | chrono_utils.h | 32 typedef std::chrono::nanoseconds duration; 33 typedef std::chrono::time_point<boot_clock, duration> time_point; 42 std::chrono::milliseconds duration() const { in duration() 43 return std::chrono::duration_cast<std::chrono::milliseconds>(boot_clock::now() - start_); in duration()
|
/system/extras/zram-perf/ |
D | zram-perf.cpp | 84 chrono::time_point<chrono::high_resolution_clock> start, end; in benchSequentialRead() 89 start = chrono::high_resolution_clock::now(); in benchSequentialRead() 100 end = chrono::high_resolution_clock::now(); in benchSequentialRead() 101 size_t duration = chrono::duration_cast<chrono::microseconds>(end - start).count(); in benchSequentialRead() 105 chrono::time_point<chrono::high_resolution_clock> start, end; in benchSequentialWrite() 110 start = chrono::high_resolution_clock::now(); in benchSequentialWrite() 122 end = chrono::high_resolution_clock::now(); in benchSequentialWrite() 123 size_t duration = chrono::duration_cast<chrono::microseconds>(end - start).count(); in benchSequentialWrite()
|
/system/bt/vendor_libs/test_vendor_lib/model/controller/ |
D | le_advertiser.h | 41 std::chrono::steady_clock::duration interval); 47 std::chrono::steady_clock::duration interval); 54 std::chrono::steady_clock::time_point); 66 void EnableExtended(std::chrono::steady_clock::duration duration); 80 std::chrono::steady_clock::duration interval_{}; 81 std::chrono::steady_clock::time_point ending_time_{}; 83 std::chrono::steady_clock::time_point last_le_advertisement_;
|
/system/bt/gd/l2cap/internal/ |
D | parameter_provider.h | 33 virtual std::chrono::milliseconds GetClassicLinkIdleDisconnectTimeout() { in GetClassicLinkIdleDisconnectTimeout() 34 return std::chrono::seconds(20); in GetClassicLinkIdleDisconnectTimeout() 36 virtual std::chrono::milliseconds GetLeLinkIdleDisconnectTimeout() { in GetLeLinkIdleDisconnectTimeout() 37 return std::chrono::seconds(1); in GetLeLinkIdleDisconnectTimeout()
|
/system/bt/vendor_libs/test_vendor_lib/model/setup/ |
D | test_model.h | 37 std::function<AsyncTaskId(AsyncUserId, std::chrono::milliseconds, 40 std::function<AsyncTaskId(AsyncUserId, std::chrono::milliseconds, 41 std::chrono::milliseconds, const TaskCallback&)> 89 void SetTimerPeriod(std::chrono::milliseconds new_period); 104 std::function<AsyncTaskId(AsyncUserId, std::chrono::milliseconds, 107 std::function<AsyncTaskId(AsyncUserId, std::chrono::milliseconds, 108 std::chrono::milliseconds, const TaskCallback&)> 116 std::chrono::milliseconds timer_period_{};
|
/system/bt/common/ |
D | repeating_timer_unittest.cc | 55 std::this_thread::sleep_for(std::chrono::milliseconds(sleep_ms)); in SleepAndIncreaseCounter() 59 void VerifyDelayTimeAndSleep(std::chrono::steady_clock::time_point start_time, in VerifyDelayTimeAndSleep() 63 auto end_time = std::chrono::steady_clock::now(); in VerifyDelayTimeAndSleep() 64 auto actual_delay = std::chrono::duration_cast<std::chrono::milliseconds>( in VerifyDelayTimeAndSleep() 72 std::this_thread::sleep_for(std::chrono::milliseconds(task_length_ms)); in VerifyDelayTimeAndSleep() 82 auto start_time = std::chrono::steady_clock::now(); in VerifyMultipleDelayedTasks() 163 std::this_thread::sleep_for(std::chrono::milliseconds(delay_error_ms)); in TEST_F() 179 std::this_thread::sleep_for(std::chrono::milliseconds(delay_error_ms)); in TEST_F() 190 std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms)); in TEST_F() 210 std::chrono::milliseconds(delay_ms + delay_error_ms)); in TEST_F() [all …]
|
/system/netd/libnetdutils/include/netdutils/ |
D | Stopwatch.h | 27 using clock = std::chrono::steady_clock; 28 using time_point = std::chrono::time_point<clock>; 46 return (std::chrono::duration_cast<std::chrono::microseconds>(now - mStart)).count(); in getElapsedUs()
|