Move nano-count>timestamp word to core-foundation.run-loop since its pretty specialized
parent
6a2cf3516d
commit
3d585fa858
|
@ -397,9 +397,6 @@ M: duration time-
|
||||||
: hence ( duration -- timestamp ) now swap time+ ;
|
: hence ( duration -- timestamp ) now swap time+ ;
|
||||||
: ago ( 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 ( year month day -- n )
|
||||||
#! Zeller Congruence
|
#! Zeller Congruence
|
||||||
#! http://web.textfiles.com/computers/formulas.txt
|
#! http://web.textfiles.com/computers/formulas.txt
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors alien alien.c-types alien.syntax kernel math
|
USING: accessors alien alien.c-types alien.syntax kernel math
|
||||||
namespaces sequences destructors combinators threads heaps
|
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.file-descriptors core-foundation.timers
|
||||||
core-foundation.time ;
|
core-foundation.time ;
|
||||||
IN: core-foundation.run-loop
|
IN: core-foundation.run-loop
|
||||||
|
@ -96,6 +96,9 @@ TUPLE: run-loop fds sources timers ;
|
||||||
: ((reset-timer)) ( timer counter timestamp -- )
|
: ((reset-timer)) ( timer counter timestamp -- )
|
||||||
nip >CFAbsoluteTime CFRunLoopTimerSetNextFireDate ;
|
nip >CFAbsoluteTime CFRunLoopTimerSetNextFireDate ;
|
||||||
|
|
||||||
|
: nano-count>timestamp ( x -- timestamp )
|
||||||
|
nano-count - nanoseconds now time+ ;
|
||||||
|
|
||||||
: (reset-timer) ( timer counter -- )
|
: (reset-timer) ( timer counter -- )
|
||||||
yield {
|
yield {
|
||||||
{ [ dup 0 = ] [ now ((reset-timer)) ] }
|
{ [ dup 0 = ] [ now ((reset-timer)) ] }
|
||||||
|
|
Loading…
Reference in New Issue