about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-14 11:39:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-14 11:39:40 -0700
commitf3a3bdf1e0a21059cb481c9ffd79ef7c7da2a0b7 (patch)
tree9b0a527fc1d207b58b5f9995a1c89bb1d197dcfd
parent441202fac4e453887f97cfe318ca5134d13c2024 (diff)
downloadmu-f3a3bdf1e0a21059cb481c9ffd79ef7c7da2a0b7.tar.gz
906 - arc averages 800-900 cycles per second
No context-switching between routines, either.
-rw-r--r--mu.arc6
-rw-r--r--trace.mu2
2 files changed, 8 insertions, 0 deletions
diff --git a/mu.arc b/mu.arc
index 72a0d86c..283f056f 100644
--- a/mu.arc
+++ b/mu.arc
@@ -498,6 +498,7 @@
 ($:define (reset) (tput 'sgr0))
 
 (= new-string-foo* nil)
+(= last-print* 0)
 
 ; run instructions from 'routine*' for 'time-slice'
 (def run-for-time-slice (time-slice)
@@ -512,6 +513,11 @@
           (die "No results returned: @(tostring:pr (body.routine* pc.routine*))"))
         (++ pc.routine*))
       (++ curr-cycle*)
+      (when (no ($.current-charterm))
+        (let curr (seconds)
+          (when (~is curr last-print*)
+            (prn curr " " curr-cycle* " " len.running-routines*)
+            (= last-print* curr))))
 ;?       (trace "run" "-- " int-canon.memory*) ;? 1
 ;?       (trace "run" curr-cycle*)
       (trace "run" label.routine* " " pc.routine* ": " (body.routine* pc.routine*))
diff --git a/trace.mu b/trace.mu
index b327a1d6..eba9b477 100644
--- a/trace.mu
+++ b/trace.mu
@@ -27,6 +27,7 @@
   { begin
     (done?:boolean <- end-of-stream? in:stream-address)
     (break-if done?:boolean)
+;?     ($start-tracing) ;? 1
     (c:character <- read-character in:stream-address)
     { begin
       (newline?:boolean <- equal c:character ((#\newline literal)))
@@ -40,6 +41,7 @@
         ($print (("\n" literal)))
       }
     }
+;?     ($quit) ;? 1
     (loop)
   }
   ($print n:integer)