rt: rename nano_time() builtin to match time::precise_time_ns()
This commit is contained in:
@@ -5,7 +5,7 @@ Module: time
|
|||||||
#[abi = "cdecl"]
|
#[abi = "cdecl"]
|
||||||
native mod rustrt {
|
native mod rustrt {
|
||||||
fn get_time(&sec: u32, &usec: u32);
|
fn get_time(&sec: u32, &usec: u32);
|
||||||
fn nano_time(&ns: u64);
|
fn precise_time_ns(&ns: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -34,7 +34,7 @@ Function: precise_time_ns
|
|||||||
Returns the current value of a high-resolution performance counter
|
Returns the current value of a high-resolution performance counter
|
||||||
in nanoseconds since an unspecified epoch.
|
in nanoseconds since an unspecified epoch.
|
||||||
*/
|
*/
|
||||||
fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::nano_time(ns); ret ns; }
|
fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::precise_time_ns(ns); ns }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: precise_time_s
|
Function: precise_time_s
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ get_time(uint32_t *sec, uint32_t *usec) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern "C" CDECL void
|
extern "C" CDECL void
|
||||||
nano_time(uint64_t *ns) {
|
precise_time_ns(uint64_t *ns) {
|
||||||
timer t;
|
timer t;
|
||||||
*ns = t.time_ns();
|
*ns = t.time_ns();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ get_port_id
|
|||||||
get_task_id
|
get_task_id
|
||||||
get_time
|
get_time
|
||||||
last_os_error
|
last_os_error
|
||||||
nano_time
|
|
||||||
new_port
|
new_port
|
||||||
new_task
|
new_task
|
||||||
port_recv
|
port_recv
|
||||||
|
precise_time_ns
|
||||||
rust_port_select
|
rust_port_select
|
||||||
rand_free
|
rand_free
|
||||||
rand_new
|
rand_new
|
||||||
|
|||||||
Reference in New Issue
Block a user