Skip to content

Commit 24daceb

Browse files
17314642flightlessmango
authored andcommitted
gpu_fdinfo: use sleep instead of time comparison
1 parent 3320601 commit 24daceb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/gpu_fdinfo.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ void GPU_fdinfo::get_load() {
169169
static float power_usage_now, previous_power_usage;
170170

171171
now = os_time_get_nano();
172-
173-
if (now - previous_time < METRICS_UPDATE_PERIOD_MS * 1'000'000)
174-
continue;
175-
176172
gpu_time_now = get_gpu_time();
177173
power_usage_now = get_power_usage();
178174

@@ -193,5 +189,7 @@ void GPU_fdinfo::get_load() {
193189
previous_time = now;
194190
previous_power_usage = power_usage_now;
195191
}
192+
193+
std::this_thread::sleep_for(std::chrono::milliseconds(METRICS_UPDATE_PERIOD_MS));
196194
}
197195
}

0 commit comments

Comments
 (0)