mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Try to have time_ns same as std
This commit is contained in:
@@ -121,18 +121,11 @@ mod decl {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "wasi"))]
|
||||
#[pyfunction]
|
||||
fn time_ns(vm: &VirtualMachine) -> PyResult<u64> {
|
||||
Ok(duration_since_system_now(vm)?.as_nanos() as u64)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "wasi")]
|
||||
#[pyfunction]
|
||||
fn time_ns(_vm: &VirtualMachine) -> PyResult<u64> {
|
||||
unimplemented!("time.time_ns is not implemented yet for wasi");
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
pub fn time(vm: &VirtualMachine) -> PyResult<f64> {
|
||||
_time(vm)
|
||||
|
||||
Reference in New Issue
Block a user