Skip to content

Commit

Permalink
implemented 'msec
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano committed Aug 16, 2009
1 parent 785d821 commit b3d11eb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
10 changes: 8 additions & 2 deletions arc.pir
Expand Up @@ -19,6 +19,12 @@
.local int is_pir
is_pir = 0

## save start up time
$N0 = time
$P0 = new 'ArcNum'
$P0 = $N0
set_hll_global '$startup-time', $P0

load_bytecode 'ac/boot.pbc'
load_bytecode 'ac/comp.pbc'
load_bytecode 'ac/qq.pbc'
Expand All @@ -36,7 +42,7 @@
## default value for ***
$P1 = get_hll_global 'nil'
set_hll_global '***', $P1
#push_eh run_error
push_eh run_error
loop:
unless iter goto end
$S0 = shift iter
Expand Down Expand Up @@ -66,7 +72,7 @@ run_error:
eval_mode:
$P0 = getstdin
loop2:
#push_eh error # never give up
push_eh error # never give up
$S0 = $P0.'readline_interactive'( 'arc> ' )
$P2 = _compile_and_eval($S0)
##print ' -> '
Expand Down
19 changes: 15 additions & 4 deletions builtins.pir
Expand Up @@ -428,9 +428,14 @@ end:
.sub 'ccc'
.param pmc f

interpinfo $P0, .INTERPINFO_CURRENT_CONT

.tailcall f($P0)
$P0 = new 'Continuation'
set_addr $P0, continue
$P0 = f($P0)
continue:
# .local pmc res
# .get_results (res)
# .return (res)
.return ($P0)
.end

.sub 'pr'
Expand Down Expand Up @@ -984,7 +989,13 @@ handle_err:
## only stubs

.sub 'msec'
.return (0)
$N0 = time
$P0 = get_hll_global '$startup-time'
$N1 = $P0
$N0 = $N0 - $N1
$N0 = $N0*1000000
$I0 = $N0
.return ($I0)
.end

.sub 'current-process-milliseconds'
Expand Down

0 comments on commit b3d11eb

Please sign in to comment.