From 6ea4a96ca0926ad2437d824106ee4d2564a9e121 Mon Sep 17 00:00:00 2001 From: Carl Gay Date: Mon, 21 Oct 2024 17:10:33 -0400 Subject: [PATCH] WIP - microsecond-counter, see https://github.com/dylan-lang/opendylan/pull/1626 --- sources/library.dylan | 7 ++- sources/time-test.dylan | 4 ++ sources/unix-portability.c | 105 +++++++++++++++++++++++++++++++++++++ sources/unix-time.dylan | 60 +++++++++++++++++++++ 4 files changed, 175 insertions(+), 1 deletion(-) diff --git a/sources/library.dylan b/sources/library.dylan index 6645426..76c4485 100644 --- a/sources/library.dylan +++ b/sources/library.dylan @@ -2,10 +2,11 @@ Module: dylan-user define library time use big-integers; + use c-ffi; use collections, import: { table-extensions }; use common-dylan; - use c-ffi; + use dylan; //, import: dylan-direct-c-ffi; use generic-arithmetic; use io, import: { format, format-out, print, pprint, standard-io, streams }; @@ -87,6 +88,9 @@ define module time // time - duration => time // duration - duration => duration + // Low-level timing primitives + microsecond-counter, + // Zones , zone-abbreviation, @@ -103,6 +107,7 @@ end module time; define module %time use time; + use dylan-direct-c-ffi; use c-ffi; use common-dylan; use file-system, diff --git a/sources/time-test.dylan b/sources/time-test.dylan index 18058e0..621b1b5 100644 --- a/sources/time-test.dylan +++ b/sources/time-test.dylan @@ -90,3 +90,7 @@ define test test-print-object () assert-true(regex-search(compile-regex("{