Files
wasmtime/crates/wasi-common/winx/src/time.rs
Dan Gohman 22641de629 Initial reorg.
This is largely the same as #305, but updated for the current tree.
2019-11-08 06:35:40 -08:00

11 lines
334 B
Rust

use cvt::cvt;
use winapi::um::{profileapi::QueryPerformanceFrequency, winnt::LARGE_INTEGER};
pub fn perf_counter_frequency() -> std::io::Result<u64> {
unsafe {
let mut frequency: LARGE_INTEGER = std::mem::zeroed();
cvt(QueryPerformanceFrequency(&mut frequency))?;
Ok(*frequency.QuadPart() as u64)
}
}