base/sys/linux/platform_timer_resolution.rs
1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::EnabledHighResTimer;
6use crate::Result;
7
8/// Noop struct on unix.
9/// On windows, restores the platform timer resolution to its original value on Drop.
10pub struct UnixSetTimerResolution {}
11impl EnabledHighResTimer for UnixSetTimerResolution {}
12
13pub fn enable_high_res_timers() -> Result<Box<dyn EnabledHighResTimer>> {
14 Ok(Box::new(UnixSetTimerResolution {}))
15}