]> gitweb.factorcode.org Git - factor.git/commitdiff
Replace millis primitive with micros primitive
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 19 Nov 2008 07:50:05 +0000 (01:50 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 19 Nov 2008 07:50:05 +0000 (01:50 -0600)
Add millis as a library word
sleep now takes either a duration or a microsecond count; code using durations doens't need to be updated, code using millisecond counts updated to use durations for the most part

59 files changed:
basis/bootstrap/stage2.factor
basis/calendar/calendar-docs.factor
basis/calendar/calendar-tests.factor
basis/calendar/calendar.factor
basis/calendar/model/model.factor
basis/compiler/tests/alien.factor
basis/concurrency/combinators/combinators-tests.factor
basis/concurrency/flags/flags-tests.factor
basis/concurrency/futures/futures-docs.factor
basis/concurrency/locks/locks-tests.factor
basis/concurrency/promises/promises-docs.factor
basis/core-foundation/run-loop/run-loop.factor
basis/io/launcher/launcher.factor
basis/io/unix/files/files.factor
basis/io/unix/kqueue/kqueue.factor
basis/io/unix/select/select.factor
basis/io/windows/nt/pipes/pipes.factor
basis/smtp/smtp.factor
basis/stack-checker/known-words/known-words.factor
basis/stack-checker/stack-checker.factor
basis/threads/threads-docs.factor
basis/threads/threads.factor
basis/tools/deploy/test/1/1.factor
basis/tools/profiler/profiler-tests.factor
basis/tools/threads/threads.factor
basis/tools/time/time-docs.factor
basis/tools/time/time.factor
basis/ui/gestures/gestures-docs.factor
basis/ui/gestures/gestures.factor
basis/ui/tools/interactor/interactor-tests.factor
basis/ui/tools/listener/listener-tests.factor
basis/ui/tools/search/search-tests.factor
basis/ui/ui.factor
basis/unix/time/time.factor
core/alien/alien-docs.factor
core/bootstrap/primitives.factor
core/io/backend/backend-docs.factor
core/io/streams/c/c.factor
core/system/system-docs.factor
core/system/system.factor
extra/crypto/timing/timing.factor
extra/jamshred/jamshred.factor
extra/mason/test/test.factor
extra/nehe/4/4.factor
extra/nehe/5/5.factor
extra/openal/example/example.factor
vm/data_gc.c
vm/data_gc.h
vm/factor.c
vm/os-unix.c
vm/os-unix.h
vm/os-windows-ce.c
vm/os-windows-ce.h
vm/os-windows-nt.c
vm/os-windows.c
vm/os-windows.h
vm/primitives.c
vm/run.c
vm/run.h

index d25394e978ba5122f6425aa4684b59e06bec64cf..78d555fe92f054ee3311720aa9548c0dabc41e1c 100644 (file)
@@ -32,8 +32,8 @@ SYMBOL: bootstrap-time
 : count-words ( pred -- )
     all-words swap count number>string write ;
 
-: print-time ( time -- )
-    1000 /i
+: print-time ( us -- )
+    1000000 /i
     60 /mod swap
     number>string write
     " minutes and " write number>string write " seconds." print ;
@@ -52,7 +52,7 @@ SYMBOL: bootstrap-time
 
 [
     ! We time bootstrap
-    millis
+    micros
 
     default-image-name "output-image" set-global
 
@@ -77,7 +77,7 @@ SYMBOL: bootstrap-time
     [
         load-components
 
-        millis over - core-bootstrap-time set-global
+        micros over - core-bootstrap-time set-global
 
         run-bootstrap-init
     ] with-compiler-errors
@@ -100,7 +100,7 @@ SYMBOL: bootstrap-time
             ] [ print-error 1 exit ] recover
         ] set-boot-quot
 
-        millis swap - bootstrap-time set-global
+        micros swap - bootstrap-time set-global
         print-report
 
         "output-image" get save-image-and-exit
index 64c74a494a4dd35c359557371880844ea7046481..433459cb24457823fd5b61c253f88132580c0d19 100644 (file)
@@ -365,12 +365,12 @@ HELP: unix-1970
 { $values { "timestamp" timestamp } }
 { $description "Outputs the beginning of UNIX time, or midnight, January 1, 1970." } ;
 
-HELP: millis>timestamp
+HELP: micros>timestamp
 { $values { "x" number } { "timestamp" timestamp } }
-{ $description "Converts a number of milliseconds into a timestamp value in GMT time." }
+{ $description "Converts a number of microseconds into a timestamp value in GMT time." }
 { $examples
     { $example "USING: accessors calendar prettyprint ;"
-               "1000 millis>timestamp year>> ."
+               "1000 micros>timestamp year>> ."
                "1970"
     }
 } ;
index 995bd23c091392100cdc6e117eb3b817e3dd0c27..00d5730745728979aa94b2e49007e9e0f7327e07 100644 (file)
@@ -143,10 +143,10 @@ IN: calendar.tests
 [ +gt+ ] [ 2005 1 1 12 30 0 instant <timestamp>
         2004 1 1 13 30 0 instant <timestamp> <=> ] unit-test
 
-[ t ] [ now timestamp>millis millis - 1000 < ] unit-test
-[ t ] [ 0 millis>timestamp unix-1970 = ] unit-test
-[ t ] [ 123456789000 [ millis>timestamp timestamp>millis ] keep = ] unit-test
-[ t ] [ 123456789123456 [ millis>timestamp timestamp>millis ] keep = ] unit-test
+[ t ] [ now timestamp>micros micros - 1000000 < ] unit-test
+[ t ] [ 0 micros>timestamp unix-1970 = ] unit-test
+[ t ] [ 123456789000000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
+[ t ] [ 123456789123456000 [ micros>timestamp timestamp>micros ] keep = ] unit-test
 
 : checktime+ now dup clone [ rot time+ drop ] keep = ;
 
index c0027607488f64a9238d27ecdafefdf940a8c1de..a78cf60eb0147d204966fbf8c5783df5ba639f47 100644 (file)
@@ -325,9 +325,15 @@ M: duration time-
 : timestamp>millis ( timestamp -- n )
     unix-1970 (time-) 1000 * >integer ;
 
+: micros>timestamp ( x -- timestamp )
+    >r unix-1970 r> microseconds time+ ;
+
+: timestamp>micros ( timestamp -- n )
+    unix-1970 (time-) 1000000 * >integer ;
+
 : gmt ( -- timestamp )
     #! GMT time, right now
-    unix-1970 millis milliseconds time+ ;
+    unix-1970 micros microseconds time+ ;
 
 : now ( -- timestamp ) gmt >local-time ;
 : hence ( duration -- timestamp ) now swap time+ ;
@@ -404,7 +410,7 @@ PRIVATE>
 : since-1970 ( duration -- timestamp )
     unix-1970 time+ >local-time ;
 
-M: timestamp sleep-until timestamp>millis sleep-until ;
+M: timestamp sleep-until timestamp>micros sleep-until ;
 
 M: duration sleep hence sleep-until ;
 
index 60a61c20267b386357bf161409d7fdaa589ddab1..8665cc22cefe67749a59f0dca7fbe8bd490a42a8 100644 (file)
@@ -7,7 +7,7 @@ SYMBOL: time
 \r
 : (time-thread) ( -- )\r
     now time get set-model\r
-    1000 sleep (time-thread) ;\r
+    1 seconds sleep (time-thread) ;\r
 \r
 : time-thread ( -- )\r
     [\r
index 3ca6fc87f3d14ef2cbcba5ba799560a5011b35b5..abcdb46ea2744e532c1773bb3a382fe285538bf3 100644 (file)
@@ -361,7 +361,7 @@ FUNCTION: ulonglong ffi_test_38 ( ulonglong x, ulonglong y ) ;
 [ 1 2 3 ] [ callback-6 callback_test_1 1 2 3 ] unit-test
 
 : callback-7 ( -- callback )
-    "void" { } "cdecl" [ 1000 sleep ] alien-callback ;
+    "void" { } "cdecl" [ 1000000 sleep ] alien-callback ;
 
 [ 1 2 3 ] [ callback-7 callback_test_1 1 2 3 ] unit-test
 
index 562111242d0040d56d629b572e896e7d1dd27358..440a6766c55a80ae43ce72242708d2bfb41088bc 100644 (file)
@@ -10,7 +10,7 @@ concurrency.mailboxes threads sequences accessors arrays ;
 \r
 [ { 1 4 9 } ] [ { 1 2 3 } [ sq ] parallel-map ] unit-test\r
 \r
-[ { 1 4 9 } ] [ { 1 2 3 } [ 1000 random sleep sq ] parallel-map ] unit-test\r
+[ { 1 4 9 } ] [ { 1 2 3 } [ 1000000 random sleep sq ] parallel-map ] unit-test\r
 \r
 [ { 1 2 3 } [ dup 2 mod 0 = [ "Even" throw ] when ] parallel-map ]\r
 [ error>> "Even" = ] must-fail-with\r
index 9d3f6de98cb0cba25824145fc231d369960a58f2..0f78183abaade2cd0d4aa2ed645f3c7dc3128a46 100644 (file)
@@ -1,6 +1,6 @@
 IN: concurrency.flags.tests\r
 USING: tools.test concurrency.flags concurrency.combinators\r
-kernel threads locals accessors ;\r
+kernel threads locals accessors calendar ;\r
 \r
 :: flag-test-1 ( -- )\r
     [let | f [ <flag> ] |\r
@@ -13,7 +13,7 @@ kernel threads locals accessors ;
 \r
 :: flag-test-2 ( -- )\r
     [let | f [ <flag> ] |\r
-        [ 1000 sleep f raise-flag ] "Flag test" spawn drop\r
+        [ 1 seconds sleep f raise-flag ] "Flag test" spawn drop\r
         f lower-flag\r
         f value>>\r
     ] ;\r
@@ -39,7 +39,7 @@ kernel threads locals accessors ;
 \r
 :: flag-test-5 ( -- )\r
     [let | f [ <flag> ] |\r
-        [ 1000 sleep f raise-flag ] "Flag test" spawn drop\r
+        [ 1 seconds sleep f raise-flag ] "Flag test" spawn drop\r
         f wait-for-flag\r
         f value>>\r
     ] ;\r
@@ -48,6 +48,6 @@ kernel threads locals accessors ;
 \r
 [ ] [\r
     { 1 2 } <flag>\r
-    [ [ 1000 sleep raise-flag ] curry "Flag test" spawn drop ]\r
+    [ [ 1 seconds sleep raise-flag ] curry "Flag test" spawn drop ]\r
     [ [ wait-for-flag drop ] curry parallel-each ] bi\r
 ] unit-test\r
index 22549c1720260dfc8f3e82bc4b6e79193e70407c..3d2ac552de7091c8886d97ae7b1c68c57fb00482 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005, 2008 Chris Double, Slava Pestov.\r
 ! See http://factorcode.org/license.txt for BSD license.\r
 USING: concurrency.promises concurrency.messaging kernel arrays\r
-continuations help.markup help.syntax quotations ;\r
+continuations help.markup help.syntax quotations calendar ;\r
 IN: concurrency.futures\r
 \r
 HELP: future\r
@@ -11,8 +11,8 @@ $nl
 "The quotation begins with an empty data stack, an empty catch stack, and a name stack containing the global namespace only. This means that the only way to pass data to the quotation is to partially apply the data, for example using " { $link curry } " or " { $link compose } "." } ;\r
 \r
 HELP: ?future-timeout\r
-{ $values { "future" future } { "timeout" "a timeout in milliseconds or " { $link f } } { "value" object } }\r
-{ $description "Waits for a deferred computation to complete, blocking indefinitely if " { $snippet "timeout" } " is " { $link f } ", otherwise waiting up to " { $snippet "timeout" } " milliseconds." }\r
+{ $values { "future" future } { "timeout" { $maybe duration } } { "value" object } }\r
+{ $description "Waits for a deferred computation to complete, blocking indefinitely if " { $snippet "timeout" } " is " { $link f } ", otherwise waiting up to the " { $snippet "timeout" } " before throwing an error." }\r
 { $errors "Throws an error if the timeout expires before the computation completes. Also throws an error if the future quotation threw an error." } ;\r
 \r
 HELP: ?future\r
index 67f9bbb15a241f5e71ceaf18b560cdb26c960222..7696e6c1ebe061a010ae0bf78da4cafda2a15863 100644 (file)
@@ -100,7 +100,7 @@ threads sequences calendar accessors ;
                c await\r
                l [\r
                    4 v push\r
-                   1000 sleep\r
+                   1 seconds sleep\r
                    5 v push\r
                ] with-write-lock\r
                c'' count-down\r
@@ -139,7 +139,7 @@ threads sequences calendar accessors ;
                l [\r
                    1 v push\r
                    c count-down\r
-                   1000 sleep\r
+                   1 seconds sleep\r
                    2 v push\r
                ] with-write-lock\r
                c' count-down\r
index be7a8cf65b932b0d4b941fe459dd2221bc293b64..8e160842a93d5f7abb0c907a70723f6bc8d32ff3 100644 (file)
@@ -13,7 +13,7 @@ HELP: promise-fulfilled?
 \r
 HELP: ?promise-timeout\r
 { $values { "promise" promise } { "timeout" { $maybe duration } } { "result" object } }\r
-{ $description "Waits for another thread to fulfill a promise, returning immediately if the promise has already been fulfilled. A timeout of " { $link f } " indicates that the thread may block indefinitely, otherwise it will wait up to " { $snippet "timeout" } " milliseconds." }\r
+{ $description "Waits for another thread to fulfill a promise, returning immediately if the promise has already been fulfilled. A timeout of " { $link f } " indicates that the thread may block indefinitely, otherwise it will wait up to the " { $snippet "timeout" } " before throwing an error." }\r
 { $errors "Throws an error if the timeout expires before the promise has been fulfilled." } ;\r
 \r
 HELP: ?promise\r
index e30cc2eb6013141d3d8b139f4355901fcf430b4f..9a5666b5d3b032b0c5be4e17594a9fd12a03cf6d 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2008 Slava Pestov
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien.syntax kernel threads init namespaces alien
-core-foundation ;
+core-foundation calendar ;
 IN: core-foundation.run-loop
 
 : kCFRunLoopRunFinished 1 ; inline
@@ -30,7 +30,7 @@ FUNCTION: SInt32 CFRunLoopRunInMode (
 
 : run-loop-thread ( -- )
     CFRunLoopDefaultMode 0 f CFRunLoopRunInMode
-    kCFRunLoopRunHandledSource = [ 1000 sleep ] unless
+    kCFRunLoopRunHandledSource = [ 1 seconds sleep ] unless
     run-loop-thread ;
 
 : start-run-loop-thread ( -- )
index 3e1ef6ce0586e2d551bfd866899b0b9bb33b0d9c..bdccfc3f5713375ac66349497b3fb233a3402d56 100644 (file)
@@ -4,7 +4,8 @@ USING: system kernel namespaces strings hashtables sequences
 assocs combinators vocabs.loader init threads continuations
 math accessors concurrency.flags destructors environment
 io io.backend io.timeouts io.pipes io.pipes.private io.encodings
-io.streams.duplex io.ports debugger prettyprint summary ;
+io.streams.duplex io.ports debugger prettyprint summary
+calendar ;
 IN: io.launcher
 
 TUPLE: process < identity-tuple
@@ -65,7 +66,7 @@ SYMBOL: wait-flag
 : wait-loop ( -- )
     processes get assoc-empty?
     [ wait-flag get-global lower-flag ]
-    [ wait-for-processes [ 100 sleep ] when ] if ;
+    [ wait-for-processes [ 100 milliseconds sleep ] when ] if ;
 
 : start-wait-thread ( -- )
     <flag> wait-flag set-global
index 3f254e771341d203b8ab76dc23f972883d55a8a5..fb8615c47b5338f05cac03ed4dde13dfbba22818 100644 (file)
@@ -290,7 +290,7 @@ M: string other-execute? ( path -- ? ) OTHER-EXECUTE file-mode? ;
     dup length [ over [ pick set-timeval-nth ] [ 2drop ] if ] 2each ;
 
 : timestamp>timeval ( timestamp -- timeval )
-    unix-1970 time- duration>milliseconds make-timeval ;
+    unix-1970 time- duration>microseconds make-timeval ;
 
 : timestamps>byte-array ( timestamps -- byte-array )
     [ dup [ timestamp>timeval ] when ] map make-timeval-array ;
index b3e69a453cd8ae18942695187a7a41f4349f836c..ba4240de7ff8d94b3835ae391cf5732b4c204fdd 100644 (file)
@@ -94,7 +94,7 @@ M: kqueue-mx unregister-io-task ( task mx -- )
 : handle-kevents ( mx n -- )
     [ over events>> kevent-nth handle-kevent ] with each ;
 
-M: kqueue-mx wait-for-events ( ms mx -- )
+M: kqueue-mx wait-for-events ( us mx -- )
     swap dup [ make-timespec ] when
     dupd wait-kevent handle-kevents ;
 
index f2a802a859591f202779c33926ae70e2ac2b7bd2..530dfe7ab3467b99ac644c81a957d9bec6275b83 100644 (file)
@@ -48,9 +48,9 @@ TUPLE: select-mx < mx read-fdset write-fdset ;
     [ write-fdset/tasks [ init-fdset ] [ underlying>> ] bi ] tri
     f ;
 
-M:: select-mx wait-for-events ( ms mx -- )
+M:: select-mx wait-for-events ( us mx -- )
     mx
-    [ init-fdsets ms dup [ make-timeval ] when select multiplexer-error ]
+    [ init-fdsets us dup [ make-timeval ] when select multiplexer-error ]
     [ [ read-fdset/tasks ] keep [ input-available ] check-fdset ]
     [ [ write-fdset/tasks ] keep [ output-available ] check-fdset ]
     tri ;
index c9bf1ebf423f3c6b71c0c79f0819277717a55b3b..d498875c8755b4d573cc02e6bec0c01599c36291 100644 (file)
@@ -35,7 +35,7 @@ IN: io.windows.nt.pipes
         "-" %
         32 random-bits #
         "-" %
-        millis #
+        micros #
     ] "" make ;
 
 M: winnt (pipe) ( -- pipe )
index c17bccf064834a76f73a2a42517f3c607cd38839..63603ad131dc72ae4132351f38ce3bf52fa6a85f 100644 (file)
@@ -145,7 +145,7 @@ ERROR: invalid-header-string string ;
         "<" %
         64 random-bits #
         "-" %
-        millis #
+        micros #
         "@" %
         smtp-domain get [ host-name ] unless* %
         ">" %
index fdc4b4b35c5d5204c6ac056dcc6b587cef608f4f..7ee46cb440609c98a81149922c7d4ee0ede2cba7 100644 (file)
@@ -423,8 +423,8 @@ do-primitive alien-invoke alien-indirect alien-callback
 \ code-room { } { integer integer integer integer } define-primitive
 \ code-room  make-flushable
 
-\ millis { } { integer } define-primitive
-\ millis make-flushable
+\ micros { } { integer } define-primitive
+\ micros make-flushable
 
 \ tag { object } { fixnum } define-primitive
 \ tag make-foldable
index c990a51cc184bd807adce0a04ba6bc4c7515209e..ff283ce9cab53e91b59954b013ec8e9e0b281874 100644 (file)
@@ -24,4 +24,7 @@ M: callable infer ( quot -- effect )
 
 : forget-effects ( -- )
     forget-errors
-    all-words [ f "inferred-effect" set-word-prop ] each ;
+    all-words [
+        dup subwords [ f "inferred-effect" set-word-prop ] each
+        f "inferred-effect" set-word-prop
+    ] each ;
index 471cd2bd34f5eaace074a3fbd9ccaddddf385b7d..cc2216545d4001e8beb2238f2b3a48d62c637adc 100644 (file)
@@ -100,7 +100,7 @@ HELP: sleep-queue
 { $var-description "A " { $link min-heap } " storing the queue of sleeping threads." } ;
 
 HELP: sleep-time
-{ $values { "ms/f" "a non-negative integer or " { $link f } } }
+{ $values { "us/f" "a non-negative integer or " { $link f } } }
 { $description "Outputs the time until the next sleeping thread is scheduled to wake up, which could be zero if there are threads in the run queue, or threads which need to wake up right now. If there are no runnable or sleeping threads, outputs " { $link f } "." } ;
 
 HELP: stop
index 8a4d433273c2d6a914c8ae66ccfbef374058054b..5dca7be6336e86bb321f2217eb62a077009b90d9 100644 (file)
@@ -93,7 +93,7 @@ PRIVATE>
     {
         { [ run-queue deque-empty? not ] [ 0 ] }
         { [ sleep-queue heap-empty? ] [ f ] }
-        [ sleep-queue heap-peek nip millis [-] ]
+        [ sleep-queue heap-peek nip micros [-] ]
     } cond ;
 
 DEFER: stop
@@ -106,7 +106,7 @@ DEFER: stop
 
 : expire-sleep? ( heap -- ? )
     dup heap-empty?
-    [ drop f ] [ heap-peek nip millis <= ] if ;
+    [ drop f ] [ heap-peek nip micros <= ] if ;
 
 : expire-sleep ( thread -- )
     f >>sleep-entry resume ;
@@ -184,7 +184,7 @@ M: f sleep-until
 GENERIC: sleep ( dt -- )
 
 M: real sleep
-    millis + >integer sleep-until ;
+    micros + >integer sleep-until ;
 
 : interrupt ( thread -- )
     dup state>> [
index 0ca85bca8ce9c0a4493047fd7dd99cc8584af643..63b382e2f658b88c3f84cbdaf78c9e0705384769 100644 (file)
@@ -1,6 +1,6 @@
 IN: tools.deploy.test.1\r
 USING: threads ;\r
 \r
-: deploy-test-1 ( -- ) 1000 sleep ;\r
+: deploy-test-1 ( -- ) 1000000 sleep ;\r
 \r
 MAIN: deploy-test-1\r
index f0c71aa311d68f579061511ade1fa7db4bda38c5..197ace74d8e8a7ceefdf073dc2b45ab626f3786a 100644 (file)
@@ -11,7 +11,7 @@ words ;
 
 [ ] [ [ 10 [ gc ] times ] profile ] unit-test
 
-[ ] [ [ 1000 sleep ] profile ] unit-test 
+[ ] [ [ 1000000 sleep ] profile ] unit-test 
 
 [ ] [ profile. ] unit-test
 
index 1b75e46e2545ec97b8e8abe20f564dd6d2670d28..fc4ba1f6b2641e34fa3a734399349e28f231bd47 100644 (file)
@@ -14,8 +14,8 @@ IN: tools.threads
     ] with-cell\r
     [\r
         sleep-entry>> [\r
-            key>> millis [-] number>string write\r
-            " ms" write\r
+            key>> micros [-] number>string write\r
+            " us" write\r
         ] when*\r
     ] with-cell ;\r
 \r
index fe3d709f78f9943163a63751b1afe33530ccebc7..d8dba044869f0f1290f2a3b87b5dae53716110d2 100644 (file)
@@ -7,7 +7,7 @@ ARTICLE: "timing" "Timing code"
 "A lower-level word puts timings on the stack, intead of printing:"
 { $subsection benchmark }
 "You can also read the system clock and garbage collection statistics directly:"
-{ $subsection millis } 
+{ $subsection micros } 
 { $subsection gc-stats }
 { $see-also "profiling" } ;
 
@@ -15,7 +15,7 @@ ABOUT: "timing"
 
 HELP: benchmark
 { $values { "quot" "a quotation" }
-          { "runtime" "an integer denoting milliseconds" } }
+          { "runtime" "the runtime in microseconds" } }
       { $description "Runs a quotation, measuring the total wall clock time." }
 { $notes "A nicer word for interactive use is " { $link time } "." } ;
 
@@ -23,4 +23,4 @@ HELP: time
 { $values { "quot" "a quotation" } }
 { $description "Runs a quotation and then prints the total run time and some garbage collection statistics." } ;
 
-{ benchmark millis time } related-words
+{ benchmark micros time } related-words
index 6873d6831676aff79cb0c696e9b0de7fe0696eee..f5187230de807813cdb9b7514c84d218eda07f3d 100644 (file)
@@ -5,20 +5,20 @@ namespaces system sequences splitting grouping assocs strings ;
 IN: tools.time
 
 : benchmark ( quot -- runtime )
-    millis >r call millis r> - ; inline
+    micros >r call micros r> - ; inline
 
 : time. ( data -- )
     unclip
-    "==== RUNNING TIME" print nl pprint " ms" print nl
+    "==== RUNNING TIME" print nl pprint " us" print nl
     4 cut*
     "==== GARBAGE COLLECTION" print nl
     [
         6 group
         {
             "GC count:"
-            "Cumulative GC time (ms):"
-            "Longest GC pause (ms):"
-            "Average GC pause (ms):"
+            "Cumulative GC time (us):"
+            "Longest GC pause (us):"
+            "Average GC pause (us):"
             "Objects copied:"
             "Bytes copied:"
         } prefix
@@ -37,4 +37,4 @@ IN: tools.time
     ] bi* ;
 
 : time ( quot -- )
-    gc-reset millis >r call gc-stats millis r> - prefix time. ; inline
+    gc-reset micros >r call gc-stats micros r> - prefix time. ; inline
index 3471bd2cdb21a47319960fcf1d314dd0333e706c..1db0d04f43baed15e01a9046279dd2dc216bb2aa 100644 (file)
@@ -147,7 +147,7 @@ HELP: hand-last-button
 { $var-description "Global variable. The mouse button most recently pressed." } ;
 
 HELP: hand-last-time
-{ $var-description "Global variable. The timestamp of the most recent mouse button click. This timestamp has the same format as the output value of " { $link millis } "." } ;
+{ $var-description "Global variable. The timestamp of the most recent mouse button click. This timestamp has the same format as the output value of " { $link micros } "." } ;
 
 HELP: hand-buttons
 { $var-description "Global variable. A vector of mouse buttons currently held down." } ;
index 2a29d320558a80009d63b981cee3d38748842078..e37bea538f6a232969c1ff1c2cc8efde3003af6f 100644 (file)
@@ -94,7 +94,7 @@ SYMBOL: scroll-direction
 { 0 0 } scroll-direction set-global
 
 SYMBOL: double-click-timeout
-300 double-click-timeout set-global
+300 milliseconds double-click-timeout set-global
 
 : hand-moved? ( -- ? )
     hand-loc get hand-click-loc get = not ;
@@ -182,7 +182,7 @@ SYMBOL: drag-timer
     hand-click-loc get-global swap screen-loc v- ;
 
 : multi-click-timeout? ( -- ? )
-    millis hand-last-time get - double-click-timeout get <= ;
+    now hand-last-time get time- double-click-timeout get before=? ;
 
 : multi-click-button? ( button -- button ? )
     dup hand-last-button get = ;
@@ -207,7 +207,7 @@ SYMBOL: drag-timer
             1 hand-click# set
         ] if
         hand-last-button set
-        millis hand-last-time set
+        now hand-last-time set
     ] bind ;
 
 : update-clicked ( -- )
index 37f43faa8badb821d096f3267976fd5c0e89ba22..628570c3e36b22da93cb4b93b486d30a3b2092c1 100644 (file)
@@ -38,7 +38,7 @@ tools.test kernel calendar parser accessors calendar io ;
 
 [ ] [ [ "interactor" get stream-read-quot drop ] "B" spawn drop ] unit-test
 
-[ ] [ 1000 sleep ] unit-test
+[ ] [ 1 seconds sleep ] unit-test
 
 [ ] [ "interactor" get interactor-eof ] unit-test
 
@@ -57,11 +57,11 @@ tools.test kernel calendar parser accessors calendar io ;
     ] in-thread
 ] unit-test
 
-[ ] [ 100 sleep ] unit-test
+[ ] [ 100 milliseconds sleep ] unit-test
 
 [ ] [ "interactor" get evaluate-input ] unit-test
 
-[ ] [ 100 sleep ] unit-test
+[ ] [ 100 milliseconds sleep ] unit-test
     
 [ ] [ "interactor" get interactor-eof ] unit-test
 
@@ -80,7 +80,7 @@ tools.test kernel calendar parser accessors calendar io ;
     ] in-thread
 ] unit-test
 
-[ ] [ 100 sleep ] unit-test
+[ ] [ 100 milliseconds sleep ] unit-test
 
 [ ] [ "interactor" get evaluate-input ] unit-test
 
index 616226a9c5ef5a4c3a8147b833158d1091340907..28fdef6cb7ce4d92d18844c0d201e4c05b8a8b3c 100644 (file)
@@ -2,7 +2,8 @@ USING: continuations documents ui.tools.interactor
 ui.tools.listener hashtables kernel namespaces parser sequences
 tools.test ui.commands ui.gadgets ui.gadgets.editors
 ui.gadgets.panes vocabs words tools.test.ui slots.private
-threads arrays generic threads accessors listener math ;
+threads arrays generic threads accessors listener math
+calendar ;
 IN: ui.tools.listener.tests
 
 [ f ] [ "word" source-editor command-map commands>> empty? ] unit-test
@@ -47,7 +48,7 @@ IN: ui.tools.listener.tests
 
     [ ] [ "listener" get restart-listener ] unit-test
 
-    [ ] [ 1000 sleep ] unit-test
+    [ ] [ 1 seconds sleep ] unit-test
 
     [ ] [ "listener" get com-end ] unit-test
 ] with-grafted-gadget
index d47727452042fc246b067ad993f17d438e4bc061..c8c7c6c2191035bbe63834553cf87ad25968fb57 100644 (file)
@@ -1,7 +1,7 @@
 USING: assocs ui.tools.search help.topics io.files io.styles
 kernel namespaces sequences source-files threads
 tools.test ui.gadgets ui.gestures vocabs accessors
-vocabs.loader words tools.test.ui debugger ;
+vocabs.loader words tools.test.ui debugger calendar ;
 IN: ui.tools.search.tests
 
 [ f ] [
@@ -14,7 +14,7 @@ IN: ui.tools.search.tests
 
 : update-live-search ( search -- seq )
     dup [
-        300 sleep
+        300 milliseconds sleep
         list>> control-value
     ] with-grafted-gadget ;
 
@@ -30,7 +30,7 @@ IN: ui.tools.search.tests
     "" all-words t <definition-search>
     dup [
         { "set-word-prop" } over field>> set-control-value
-        300 sleep
+        300 milliseconds sleep
         search-value \ set-word-prop eq?
     ] with-grafted-gadget
 ] unit-test
index f561f3cd49164828a465c4c35d850f4e5cc3770e..dc868154bb3958b0048a01bc46586e724bb04db7 100644 (file)
@@ -1,10 +1,10 @@
-! Copyright (C) 2006, 2007 Slava Pestov.
+! Copyright (C) 2006, 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays assocs io kernel math models namespaces make
 prettyprint dlists deques sequences threads sequences words
 debugger ui.gadgets ui.gadgets.worlds ui.gadgets.tracks
 ui.gestures ui.backend ui.render continuations init combinators
-hashtables concurrency.flags sets accessors ;
+hashtables concurrency.flags sets accessors calendar ;
 IN: ui
 
 ! Assoc mapping aliens to gadgets
@@ -142,7 +142,7 @@ SYMBOL: ui-hook
     [ notify-queued layout-queued redraw-worlds ] assert-depth ;
 
 : ui-wait ( -- )
-    10 sleep ;
+    10 milliseconds sleep ;
 
 : ui-try ( quot -- ) [ ui-error ] recover ;
 
index c664aa3bfbb94a2a2c0b3bbc412832298ab7e11e..9847b097789b0fd3aa7d20411f980b330e1c63f9 100644 (file)
@@ -11,14 +11,14 @@ C-STRUCT: timespec
     { "time_t" "sec" }
     { "long" "nsec" } ;
 
-: make-timeval ( ms -- timeval )
-    1000 /mod 1000 *
+: make-timeval ( us -- timeval )
+    1000000 /mod
     "timeval" <c-object>
     [ set-timeval-usec ] keep
     [ set-timeval-sec ] keep ;
 
-: make-timespec ( ms -- timespec )
-    1000 /mod 1000000 *
+: make-timespec ( us -- timespec )
+    1000000 /mod 1000 *
     "timespec" <c-object>
     [ set-timespec-nsec ] keep
     [ set-timespec-sec ] keep ;
index ce3497439ab7125de6ffe61b56cdfb2457006b1e..edac8c09cc6a46dfefbfbb18e6487d751d690688 100644 (file)
@@ -281,8 +281,8 @@ $nl
         "Gives all Factor threads a chance to run."
     } }
     { {
-        { $code "void factor_sleep(long ms)" }
-        "Gives all Factor threads a chance to run for " { $snippet "ms" } " milliseconds."
+        { $code "void factor_sleep(long us)" }
+        "Gives all Factor threads a chance to run for " { $snippet "us" } " microseconds."
     } }
 } ;
 
index 24faf81662f75f43257d719997290edea8b49a06..f0aefa53cb7ee760d59382c6af8eb77a3c7758f1 100644 (file)
@@ -443,7 +443,7 @@ tuple
     { "exit" "system" }
     { "data-room" "memory" }
     { "code-room" "memory" }
-    { "millis" "system" }
+    { "micros" "system" }
     { "modify-code-heap" "compiler.units" }
     { "dlopen" "alien" }
     { "dlsym" "alien" }
index 48b49ed32b66fedc5fea449161db80c253f3479b..e129a9b0bc356293c59e3f4e6b0010e81d3f9b9c 100644 (file)
@@ -2,8 +2,8 @@ USING: help.markup help.syntax io io.backend strings
 byte-arrays ;
 
 HELP: io-multiplex
-{ $values { "ms" "a non-negative integer" } }
-{ $contract "Waits up to " { $snippet "ms" } " milliseconds for pending I/O requests to complete." } ;
+{ $values { "us" "a non-negative integer" } }
+{ $contract "Waits up to " { $snippet "us" } " microseconds for pending I/O requests to complete." } ;
 
 HELP: init-io
 { $contract "Initializes the I/O system. Called on startup." } ;
index 1e12d7e9567d0b485c2b538383264bbe8dd7f8a5..287ee3ad952c74e7453ac9e1f8ae212c78ab5641 100644 (file)
@@ -67,7 +67,7 @@ M: c-io-backend init-io ;
 
 M: c-io-backend (init-stdio) init-c-stdio ;
 
-M: c-io-backend io-multiplex 60 60 * 1000 * or (sleep) ;
+M: c-io-backend io-multiplex 60 60 * 1000 * 1000 * or (sleep) ;
 
 M: c-io-backend (file-reader)
     "rb" fopen <c-reader> ;
index acd42b094f9a61c713391c7518cd9fa5ab92ed08..3adf82af7feca35846f78d532720f8013b29d3ba 100644 (file)
@@ -11,7 +11,7 @@ ARTICLE: "system" "System interface"
 { $subsection vm }
 { $subsection image }
 "Getting the current time:"
-{ $subsection millis }
+{ $subsection micros }
 "Exiting the Factor VM:"
 { $subsection exit } ;
 
@@ -64,8 +64,13 @@ HELP: exit ( n -- )
 { $values { "n" "an integer exit code" } }
 { $description "Exits the Factor process." } ;
 
-HELP: millis ( -- n )
-{ $values { "n" integer } }
+HELP: micros ( -- us )
+{ $values { "us" integer } }
+{ $description "Outputs the number of microseconds ellapsed since midnight January 1, 1970." }
+{ $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
+
+HELP: millis ( -- ms )
+{ $values { "us" integer } }
 { $description "Outputs the number of milliseconds ellapsed since midnight January 1, 1970." }
 { $notes "This is a low-level word. The " { $vocab-link "calendar" } " vocabulary provides features for date/time arithmetic and formatting." } ;
 
index 66662a23e1de2d4e911de3fedaa72128cf61703f..2d8ed1b657fb085a9f92d362b6ba627cf55c5fac 100644 (file)
@@ -65,3 +65,5 @@ PRIVATE>
 ] "system" add-init-hook
 
 : embedded? ( -- ? ) 15 getenv ;
+
+: millis ( -- ms ) micros 1000 /i ;
index a17d65d90bfcde020aee0383b0a790ef69d6e46f..8fdb807c6a7a87df104c10f9c939811e55fa9da4 100644 (file)
@@ -1,6 +1,6 @@
-USING: kernel math threads system ;
+USING: kernel math threads system calendar ;
 IN: crypto.timing
 
 : with-timing ( quot n -- )
     #! force the quotation to execute in, at minimum, n milliseconds
-    millis 2slip millis - + sleep ; inline
+    millis 2slip millis - + milliseconds sleep ; inline
index 2357742fdeb75d0c27253039e2a10490400739e6..d0b74417d188c3b9b50f40cb1c8b7236c02edaef 100755 (executable)
@@ -23,7 +23,7 @@ M: jamshred-gadget draw-gadget* ( gadget -- )
     ] [
         [ jamshred>> jamshred-update ]
         [ relayout-1 ]
-        [ 10 sleep yield jamshred-loop ] tri
+        [ 10 milliseconds sleep yield jamshred-loop ] tri
     ] if ;
 
 : fullscreen ( gadget -- )
index 0206df7db913141ee75c91179a714497382637c5..3de1fa643f46f8d675a81bd368297263a0ab80e9 100644 (file)
@@ -40,14 +40,17 @@ M: method-body word-vocabulary "method-generic" word-prop word-vocabulary ;
 : do-benchmarks ( -- )
     run-benchmarks benchmarks-file to-file ;
 
+: benchmark-ms ( quot -- ms )
+    benchmark 1000 /i ; inline
+
 : do-all ( -- )
     ".." [
         bootstrap-time get boot-time-file to-file
-        [ do-load do-compile-errors ] benchmark load-time-file to-file
-        [ generate-help ] benchmark html-help-time-file to-file
-        [ do-tests ] benchmark test-time-file to-file
-        [ do-help-lint ] benchmark help-lint-time-file to-file
-        [ do-benchmarks ] benchmark benchmark-time-file to-file
+        [ do-load do-compile-errors ] benchmark-ms load-time-file to-file
+        [ generate-help ]  html-help-time-file to-file
+        [ do-tests ] benchmark-ms test-time-file to-file
+        [ do-help-lint ] benchmark-ms help-lint-time-file to-file
+        [ do-benchmarks ] benchmark-ms benchmark-time-file to-file
     ] with-directory ;
 
 MAIN: do-all
\ No newline at end of file
index 4c1545b4ae39d865da053667936dd0a04156d96b..10217c93cbfb4087c34118730e58bdebd1b6b0bb 100644 (file)
@@ -1,12 +1,13 @@
 USING: arrays kernel math opengl opengl.gl opengl.glu
-opengl.demo-support ui ui.gadgets ui.render threads accessors ;
+opengl.demo-support ui ui.gadgets ui.render threads accessors
+calendar ;
 IN: nehe.4
 
 TUPLE: nehe4-gadget < gadget rtri rquad thread quit? ;
 
 : width 256 ;
 : height 256 ;
-: redraw-interval 10 ;
+: redraw-interval 10 milliseconds ;
 
 : <nehe4-gadget> (  -- gadget )
   nehe4-gadget new-gadget
index 59170ff96458f93c78b35ca948e4d65b5835242f..2c9b51c63fa25bbdbde983b9f728909443710c96 100755 (executable)
@@ -1,11 +1,12 @@
 USING: arrays kernel math opengl opengl.gl opengl.glu\r
-opengl.demo-support ui ui.gadgets ui.render threads accessors ;\r
+opengl.demo-support ui ui.gadgets ui.render threads accessors\r
+calendar ;\r
 IN: nehe.5\r
 \r
 TUPLE: nehe5-gadget < gadget rtri rquad thread quit? ;\r
 : width 256 ;\r
 : height 256 ;\r
-: redraw-interval 10 ;\r
+: redraw-interval 10 milliseconds ;\r
 \r
 : <nehe5-gadget> (  -- gadget )\r
   nehe5-gadget new-gadget\r
index ebdb6da5ce85a19e2cf2cf9022640500b7a18df9..ae0b50afff82b7841fb0356eeaf6766ece70bdc2 100644 (file)
@@ -2,17 +2,17 @@
 ! See http://factorcode.org/license.txt for BSD license.\r
 !\r
 IN: openal.example\r
-USING: openal kernel alien threads sequences ;\r
+USING: openal kernel alien threads sequences calendar ;\r
 \r
 : play-hello ( -- )\r
   init-openal\r
   1 gen-sources\r
   first dup AL_BUFFER  alutCreateBufferHelloWorld set-source-param\r
   source-play\r
-  1000 sleep ;\r
+  1000 milliseconds sleep ;\r
   \r
 : (play-file) ( source -- )\r
-  100 sleep\r
+  100 milliseconds sleep\r
   dup source-playing? [ (play-file) ] [ drop ] if ;\r
 \r
 : play-file ( filename -- )\r
index 9f8ffb625e1af3affba70d67ffb9da7f4fc9b84c..23836c560c62530e9c1d5a564175abe868b9d3ea 100755 (executable)
@@ -793,7 +793,7 @@ void garbage_collection(CELL gen,
                return;
        }
 
-       s64 start = current_millis();
+       s64 start = current_micros();
 
        performing_gc = true;
        growing_data_heap = growing_data_heap_;
@@ -860,7 +860,7 @@ void garbage_collection(CELL gen,
        while(scan < newspace->here)
                scan = collect_next(scan);
 
-       CELL gc_elapsed = (current_millis() - start);
+       CELL gc_elapsed = (current_micros() - start);
 
        end_gc(gc_elapsed);
 
@@ -887,14 +887,14 @@ void primitive_gc_stats(void)
        GROWABLE_ARRAY(stats);
 
        CELL i;
-       CELL total_gc_time = 0;
+       u64 total_gc_time = 0;
 
        for(i = 0; i < MAX_GEN_COUNT; i++)
        {
                F_GC_STATS *s = &gc_stats[i];
                GROWABLE_ARRAY_ADD(stats,allot_cell(s->collections));
-               GROWABLE_ARRAY_ADD(stats,allot_cell(s->gc_time));
-               GROWABLE_ARRAY_ADD(stats,allot_cell(s->max_gc_time));
+               GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(s->gc_time)));
+               GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(s->max_gc_time)));
                GROWABLE_ARRAY_ADD(stats,allot_cell(s->collections == 0 ? 0 : s->gc_time / s->collections));
                GROWABLE_ARRAY_ADD(stats,allot_cell(s->object_count));
                GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(s->bytes_copied)));
@@ -902,7 +902,7 @@ void primitive_gc_stats(void)
                total_gc_time += s->gc_time;
        }
 
-       GROWABLE_ARRAY_ADD(stats,allot_cell(total_gc_time));
+       GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(total_gc_time)));
        GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(cards_scanned)));
        GROWABLE_ARRAY_ADD(stats,tag_bignum(long_long_to_bignum(decks_scanned)));
        GROWABLE_ARRAY_ADD(stats,allot_cell(code_heap_scans));
index 0d63cc6bfee00173ec902ce27defb79f6f579def..a407ed761cf0dd801f32c5cb826625b4d4688c74 100755 (executable)
@@ -161,8 +161,8 @@ void init_data_heap(CELL gens,
 /* statistics */
 typedef struct {
        CELL collections;
-       CELL gc_time;
-       CELL max_gc_time;
+       u64 gc_time;
+       u64 max_gc_time;
        CELL object_count;
        u64 bytes_copied;
 } F_GC_STATS;
index 8e0aadb4fd2ed752804cafe3d8aa829060af8179..f198370ebe9d944626d4972c69fa10696834df0e 100755 (executable)
@@ -91,7 +91,7 @@ void init_factor(F_PARAMETERS *p)
        if(p->image == NULL)
                p->image = default_image_path();
 
-       srand(current_millis());
+       srand(current_micros());
        init_ffi();
        init_stacks(p->ds_size,p->rs_size);
        load_image(p);
@@ -216,8 +216,8 @@ void factor_yield(void)
        callback();
 }
 
-void factor_sleep(long ms)
+void factor_sleep(long us)
 {
        void (*callback)() = alien_offset(userenv[SLEEP_CALLBACK_ENV]);
-       callback(ms);
+       callback(us);
 }
index c11962f6e1dde1249b4605719a99387657cdc77a..952d2683cfe43a4356ca8c3012c4d46d10b31e5b 100755 (executable)
@@ -16,16 +16,16 @@ void start_thread(void *(*start_routine)(void *))
 
 static void *null_dll;
 
-s64 current_millis(void)
+s64 current_micros(void)
 {
        struct timeval t;
        gettimeofday(&t,NULL);
-       return (s64)t.tv_sec * 1000 + t.tv_usec / 1000;
+       return (s64)t.tv_sec * 1000000 + t.tv_usec;
 }
 
-void sleep_millis(CELL msec)
+void sleep_micros(CELL usec)
 {
-       usleep(msec * 1000);
+       usleep(usec);
 }
 
 void init_ffi(void)
index 2c5cc20e8d15ff85b10fd40db960f19e590fcd8f..97b1b39129e8e92b4d05762c388994c9f7c7f144 100755 (executable)
@@ -50,7 +50,7 @@ void unix_init_signals(void);
 void signal_handler(int signal, siginfo_t* siginfo, void* uap);
 void dump_stack_signal(int signal, siginfo_t* siginfo, void* uap);
 
-s64 current_millis(void);
-void sleep_millis(CELL msec);
+s64 current_micros(void);
+void sleep_micros(CELL usec);
 
 void open_console(void);
index 02b51b82ed4fe2fb999e0d4f5082607003a63e74..621198ff7dc58212c3fee3fbaefa6f0c8388c3c7 100755 (executable)
@@ -1,13 +1,13 @@
 #include "master.h"
 
-s64 current_millis(void)
+s64 current_micros(void)
 {
        SYSTEMTIME st;
        FILETIME ft;
        GetSystemTime(&st);
        SystemTimeToFileTime(&st, &ft);
        return (((s64)ft.dwLowDateTime
-               | (s64)ft.dwHighDateTime<<32) - EPOCH_OFFSET) / 10000;
+               | (s64)ft.dwHighDateTime<<32) - EPOCH_OFFSET) / 10;
 }
 
 char *strerror(int err)
index f1d6df6f3d5775edfeccac407108956346360691..a2be5fe475fe60490f69f5416ebab714c0b58219 100755 (executable)
@@ -22,6 +22,6 @@ char *getenv(char *name);
 #define snprintf _snprintf
 #define snwprintf _snwprintf
 
-s64 current_millis(void);
+s64 current_micros(void);
 void c_to_factor_toplevel(CELL quot);
 void open_console(void);
index e22ea1446b4c6fe9d4c306cc4e043a5905dd0c4c..f982abfb1b94c295c510a88f5b4b971dc0cb43c2 100755 (executable)
@@ -1,11 +1,11 @@
 #include "master.h"
 
-s64 current_millis(void)
+s64 current_micros(void)
 {
        FILETIME t;
        GetSystemTimeAsFileTime(&t);
        return (((s64)t.dwLowDateTime | (s64)t.dwHighDateTime<<32)
-               - EPOCH_OFFSET) / 10000;
+               - EPOCH_OFFSET) / 10;
 }
 
 long exception_handler(PEXCEPTION_POINTERS pe)
index 7d486bb86bb488b30c591f61ff0806571e49170f..0aeb77741ba896c072c4a6f241348c66a9e33429 100755 (executable)
@@ -166,7 +166,7 @@ long getpagesize(void)
        return g_pagesize;
 }
 
-void sleep_millis(DWORD msec)
+void sleep_micros(DWORD usec)
 {
-       Sleep(msec);
+       Sleep(msec / 1000);
 }
index 8d0f15648a63aed3e2b37d322929d3d912ed261f..b12d677af2bd1f5ae9d0b47055ffab3bb757e6ba 100755 (executable)
@@ -49,7 +49,7 @@ void ffi_dlopen(F_DLL *dll);
 void *ffi_dlsym(F_DLL *dll, F_SYMBOL *symbol);
 void ffi_dlclose(F_DLL *dll);
 
-void sleep_millis(DWORD msec);
+void sleep_micros(DWORD msec);
 
 INLINE void init_signals(void) {}
 INLINE void early_init(void) {}
@@ -57,5 +57,5 @@ const F_CHAR *vm_executable_path(void);
 const F_CHAR *default_image_path(void);
 long getpagesize (void);
 
-s64 current_millis(void);
+s64 current_micros(void);
 
index 69e77f81ed5529e97d2243f08d6c805352ce75aa..5adb135c820d5f46c26474d5443f37b8e67c39d7 100755 (executable)
@@ -68,7 +68,7 @@ void *primitives[] = {
        primitive_exit,
        primitive_data_room,
        primitive_code_room,
-       primitive_millis,
+       primitive_micros,
        primitive_modify_code_heap,
        primitive_dlopen,
        primitive_dlsym,
index c7d93d29c81768644439bdc2ac175ee3f5732787..b8c8d78ba1f94d08f56fde12bf60e32965f63289 100755 (executable)
--- a/vm/run.c
+++ b/vm/run.c
@@ -153,14 +153,14 @@ void primitive_exit(void)
        exit(to_fixnum(dpop()));
 }
 
-void primitive_millis(void)
+void primitive_micros(void)
 {
-       box_unsigned_8(current_millis());
+       box_unsigned_8(current_micros());
 }
 
 void primitive_sleep(void)
 {
-       sleep_millis(to_cell(dpop()));
+       sleep_micros(to_cell(dpop()));
 }
 
 void primitive_set_slot(void)
index 2dbbcc8c0640e646a7cefab8ed89e7ee120de1a1..378b93e8bd1d1b85680c86721f73f9af91228d77 100755 (executable)
--- a/vm/run.h
+++ b/vm/run.h
@@ -236,7 +236,7 @@ void primitive_os_envs(void);
 void primitive_set_os_env(void);
 void primitive_unset_os_env(void);
 void primitive_set_os_envs(void);
-void primitive_millis(void);
+void primitive_micros(void);
 void primitive_sleep(void);
 void primitive_set_slot(void);