]> gitweb.factorcode.org Git - factor.git/commitdiff
use nanoseconds in the core-foundation run-loop
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Nov 2009 01:22:36 +0000 (19:22 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Nov 2009 01:22:36 +0000 (19:22 -0600)
basis/calendar/calendar.factor
basis/core-foundation/run-loop/run-loop.factor
basis/ui/gestures/gestures.factor

index fd51feeed97e8e4fc64fe87196c54210c42ee25b..64eab3a55cac47ca31decd385b4583b17c2710c5 100644 (file)
@@ -397,6 +397,9 @@ 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
index c9d2d5c9cd33515e9ee02ca6f12f64b7e26869f8..7a6115b4332c01c18ffc53a70ce92516a0a22120 100644 (file)
@@ -101,7 +101,7 @@ TUPLE: run-loop fds sources timers ;
         { [ dup 0 = ] [ now ((reset-timer)) ] }
         { [ run-queue deque-empty? not ] [ 1 - (reset-timer) ] }
         { [ sleep-queue heap-empty? ] [ 5 minutes hence ((reset-timer)) ] }
-        [ sleep-queue heap-peek nip micros>timestamp ((reset-timer)) ]
+        [ sleep-queue heap-peek nip nano-count>timestamp ((reset-timer)) ]
     } cond ;
 
 : reset-timer ( timer -- )
index 59036f90f070f446ed79b8bbdd46cb4f3f2f55f3..f33b6ec6da8ebb38cf21cec403e38ed90c23fc7e 100644 (file)
@@ -156,7 +156,7 @@ SYMBOL: hand-click#
 SYMBOL: hand-last-button
 SYMBOL: hand-last-time
 0 hand-last-button set-global
-nano-count hand-last-time set-global
+0 hand-last-time set-global
 
 SYMBOL: hand-buttons
 V{ } clone hand-buttons set-global