aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Hillegeer <nicolas@hillegeer.com>2014-06-15 12:28:32 +0200
committerNicolas Hillegeer <nicolas@hillegeer.com>2014-07-16 17:12:34 +0200
commitf172b19f438b0bccdc1be0d82a6fe660c4bbd6e0 (patch)
tree82920ef2137db065937b0855bc550f21d6e6bbcd
parent095b4479c039f9907ade4e7319cbb6a990a13438 (diff)
downloadrneovim-f172b19f438b0bccdc1be0d82a6fe660c4bbd6e0.tar.gz
rneovim-f172b19f438b0bccdc1be0d82a6fe660c4bbd6e0.tar.bz2
rneovim-f172b19f438b0bccdc1be0d82a6fe660c4bbd6e0.zip
os: implement os_hrtime
Just an alias to uv_hrtime. Provides a high-resolution timer.
-rw-r--r--src/nvim/os/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/os/time.c b/src/nvim/os/time.c
index 90a17aa513..00ffccfaa8 100644
--- a/src/nvim/os/time.c
+++ b/src/nvim/os/time.c
@@ -22,6 +22,15 @@ void time_init(void)
uv_cond_init(&delay_cond);
}
+/// Obtain a high-resolution timer value
+///
+/// @return a timer value, not related to the time of day and not subject
+/// to clock drift. The value is expressed in nanoseconds.
+uint64_t os_hrtime(void)
+{
+ return uv_hrtime();
+}
+
/// Sleeps for a certain amount of milliseconds
///
/// @param milliseconds Number of milliseconds to sleep