Remove extra/micros since we have this in the core now

db4
Slava Pestov 2008-11-23 03:10:11 -06:00
parent 7788b3e0db
commit 3660643dcc
10 changed files with 0 additions and 55 deletions

View File

@ -1 +0,0 @@
Phil Dawes

View File

@ -1,4 +0,0 @@
IN: micros.backend
USING: io.backend ;
HOOK: (micros) io-backend ( -- n )

View File

@ -1,14 +0,0 @@
IN: micros
USING: help.syntax help.markup kernel prettyprint sequences ;
HELP: micros
{ $values { "n" "an integer" } }
{ $description "Outputs the number of microseconds ellapsed since midnight January 1, 1970"
} ;
HELP: micro-time
{ $values { "quot" "a quot" }
{ "n" "an integer" } }
{ $description "executes the quotation and pushes the number of microseconds taken onto the stack"
} ;

View File

@ -1,7 +0,0 @@
IN: micros.tests
USING: micros tools.test math math.functions system kernel ;
! a bit racy but I can't think of a better way to check this right now
[ t ]
[ millis 1000 / micros 1000000 / [ truncate ] bi@ = ] unit-test

View File

@ -1,13 +0,0 @@
IN: micros
USING: micros.backend system kernel combinators vocabs.loader math ;
: micros ( -- n ) (micros) ; inline
: micro-time ( quot -- n )
micros slip micros swap - ; inline
{
{ [ os unix? ] [ "micros.unix" ] }
{ [ os windows? ] [ "micros.windows" ] }
} cond require

View File

@ -1 +0,0 @@
Microsecond precision clock

View File

@ -1 +0,0 @@
unportable

View File

@ -1,6 +0,0 @@
IN: micros.unix
USING: micros.backend io.backend system alien.c-types kernel unix.time math ;
M: unix (micros)
"timespec" <c-object> dup f gettimeofday drop
[ timespec-sec 1000000 * ] [ timespec-nsec ] bi + ;

View File

@ -1 +0,0 @@
unportable

View File

@ -1,7 +0,0 @@
IN: micros.windows
USING: system kernel windows.time math math.functions micros.backend ;
! 116444736000000000 is the windowstime epoch offset
! since windowstime starts at 1600 and unix epoch is 1970
M: windows (micros)
windows-time 116444736000000000 - 10 / truncate ;