From 3d585fa8587f99c0f6fdab88a77421c4ed14f2d2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 19 Nov 2009 23:51:09 -0600 Subject: [PATCH] Move nano-count>timestamp word to core-foundation.run-loop since its pretty specialized --- basis/calendar/calendar.factor | 3 --- basis/core-foundation/run-loop/run-loop.factor | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/calendar/calendar.factor b/basis/calendar/calendar.factor index 64eab3a55c..fd51feeed9 100644 --- a/basis/calendar/calendar.factor +++ b/basis/calendar/calendar.factor @@ -397,9 +397,6 @@ M: duration time- : hence ( duration -- timestamp ) now swap time+ ; : ago ( duration -- timestamp ) now swap time- ; -: nano-count>timestamp ( x -- timestamp ) - nano-count - nanoseconds now time+ ; - : zeller-congruence ( year month day -- n ) #! Zeller Congruence #! http://web.textfiles.com/computers/formulas.txt diff --git a/basis/core-foundation/run-loop/run-loop.factor b/basis/core-foundation/run-loop/run-loop.factor index 7a6115b433..2370dd4562 100644 --- a/basis/core-foundation/run-loop/run-loop.factor +++ b/basis/core-foundation/run-loop/run-loop.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors alien alien.c-types alien.syntax kernel math namespaces sequences destructors combinators threads heaps -deques calendar core-foundation core-foundation.strings +deques calendar system core-foundation core-foundation.strings core-foundation.file-descriptors core-foundation.timers core-foundation.time ; IN: core-foundation.run-loop @@ -96,6 +96,9 @@ TUPLE: run-loop fds sources timers ; : ((reset-timer)) ( timer counter timestamp -- ) nip >CFAbsoluteTime CFRunLoopTimerSetNextFireDate ; +: nano-count>timestamp ( x -- timestamp ) + nano-count - nanoseconds now time+ ; + : (reset-timer) ( timer counter -- ) yield { { [ dup 0 = ] [ now ((reset-timer)) ] }