From 04adefafdf060ab85604d6481afc364f60855974 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Wed, 2 Aug 2017 19:41:13 -0400 Subject: [PATCH] zos: fix hr timer resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One tick on the high resolution clock (TOD clock) on z/OS is equivalent to (1/4.096) nanoseconds. PR-URL: https://github.com/libuv/libuv/pull/1453 Reviewed-By: Colin Ihrig Reviewed-By: Saúl Ibarra Corretgé --- src/unix/os390.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/os390.c b/src/unix/os390.c index de7df911..e0a70024 100644 --- a/src/unix/os390.c +++ b/src/unix/os390.c @@ -77,6 +77,9 @@ #pragma linkage(BPX4GTH, OS) #pragma linkage(BPX1GTH, OS) +/* TOD Clock resolution in nanoseconds */ +#define TOD_RES 4.096 + typedef unsigned data_area_ptr_assign_type; typedef union { @@ -122,7 +125,7 @@ uint64_t uv__hrtime(uv_clocktype_t type) { unsigned long long timestamp; __stckf(×tamp); /* Convert to nanoseconds */ - return timestamp / 10; + return timestamp / TOD_RES; }