Skip to content

Commit 3d202d7

Browse files
committed
rt: rename nano_time() builtin to match time::precise_time_ns()
1 parent b73bc30 commit 3d202d7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/libstd/time.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Module: time
55
#[abi = "cdecl"]
66
native mod rustrt {
77
fn get_time(&sec: u32, &usec: u32);
8-
fn nano_time(&ns: u64);
8+
fn precise_time_ns(&ns: u64);
99
}
1010

1111
/*
@@ -34,7 +34,7 @@ Function: precise_time_ns
3434
Returns the current value of a high-resolution performance counter
3535
in nanoseconds since an unspecified epoch.
3636
*/
37-
fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::nano_time(ns); ret ns; }
37+
fn precise_time_ns() -> u64 { let ns = 0u64; rustrt::precise_time_ns(ns); ns }
3838

3939
/*
4040
Function: precise_time_s

src/rt/rust_builtin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ get_time(uint32_t *sec, uint32_t *usec) {
420420
#endif
421421

422422
extern "C" CDECL void
423-
nano_time(uint64_t *ns) {
423+
precise_time_ns(uint64_t *ns) {
424424
timer t;
425425
*ns = t.time_ns();
426426
}

src/rt/rustrt.def.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ get_port_id
1313
get_task_id
1414
get_time
1515
last_os_error
16-
nano_time
1716
new_port
1817
new_task
1918
port_recv
19+
precise_time_ns
2020
rust_port_select
2121
rand_free
2222
rand_new

0 commit comments

Comments
 (0)