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 5 use crate::EnabledHighResTimer; 6 use crate::Result; 7 8 /// Noop struct on unix. 9 /// On windows, restores the platform timer resolution to its original value on Drop. 10 pub struct UnixSetTimerResolution {} 11 impl EnabledHighResTimer for UnixSetTimerResolution {} 12 enable_high_res_timers() -> Result<Box<dyn EnabledHighResTimer>>13pub fn enable_high_res_timers() -> Result<Box<dyn EnabledHighResTimer>> { 14 Ok(Box::new(UnixSetTimerResolution {})) 15 } 16