core-foundation.time: change epoch to constant.
parent
3a3f28a91b
commit
848420a377
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2008, 2010 Slava Pestov.
|
! Copyright (C) 2008, 2010 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: calendar math alien.c-types alien.syntax memoize system ;
|
USING: alien.c-types alien.syntax calendar literals math ;
|
||||||
IN: core-foundation.time
|
IN: core-foundation.time
|
||||||
|
|
||||||
TYPEDEF: double CFTimeInterval
|
TYPEDEF: double CFTimeInterval
|
||||||
|
@ -8,8 +8,10 @@ TYPEDEF: double CFAbsoluteTime
|
||||||
|
|
||||||
ALIAS: >CFTimeInterval duration>seconds
|
ALIAS: >CFTimeInterval duration>seconds
|
||||||
|
|
||||||
MEMO: epoch ( -- micros )
|
CONSTANT: epoch $[
|
||||||
T{ timestamp { year 2001 } { month 1 } { day 1 } } timestamp>micros ;
|
T{ timestamp { year 2001 } { month 1 } { day 1 } }
|
||||||
|
timestamp>micros
|
||||||
|
]
|
||||||
|
|
||||||
: >CFAbsoluteTime ( micros -- time )
|
: >CFAbsoluteTime ( micros -- time )
|
||||||
epoch - 1,000,000 /f ; inline
|
epoch - 1,000,000 /f ; inline
|
||||||
|
|
Loading…
Reference in New Issue