From 59f8d2082b2687669d0ec55213776456bfde9506 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 7 Oct 2020 07:28:43 -0700 Subject: New function: time-nsec. * configure: Test for clock_gettime, generating HAVE_CLOCK_GETTIME symbol in config.h. * time.c (time_sec_nsec): New function. (time_init): time-nsec intrinsic registered. * time.h (time_sec_nsec): Declared. * txr.1: Documented. --- txr.1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index b08edbfd..395697c3 100644 --- a/txr.1 +++ b/txr.1 @@ -55976,10 +55976,11 @@ parameter, which defaults to the value of .codn *random-state* . .SS* Time -.coNP Functions @ time and @ time-usec +.coNP Functions @, time @ time-usec and @ time-nsec .synb .mets (time) .mets (time-usec) +.mets (time-nsec) .syne .desc The @@ -55998,6 +55999,20 @@ field holds the seconds measured in the same way, and whose field extends the precision by giving number of microseconds as an integer value between 0 and 999999. +The +.code time-nsec +function is similar to +.code time-usec +except that the returned cons cell's +.code cdr +field gives a number of nanoseconds as an integer value +between 0 and 999999999. + +Note: on hosts where obtaining nanosecond precision is not available, the +.code time-nsec +function obtains a microseconds value instead, and multiplies +it by 1000. + .coNP Functions @ time-string-local and @ time-string-utc .synb .mets (time-string-local < time << format ) -- cgit v1.2.3