aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/profiler.frt
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/lib/profiler.frt')
-rw-r--r--amforth-6.5/common/lib/profiler.frt31
1 files changed, 0 insertions, 31 deletions
diff --git a/amforth-6.5/common/lib/profiler.frt b/amforth-6.5/common/lib/profiler.frt
deleted file mode 100644
index d2515e7..0000000
--- a/amforth-6.5/common/lib/profiler.frt
+++ /dev/null
@@ -1,31 +0,0 @@
-\ A profiler counts the number of calls
-\ of any word being defined afterwards.
-\
-\ global state: on and off
-variable profiling?
-: profile:on -1 profiling? ! ;
-: profile:off 0 profiling? ! ;
-
-: profiler profiling? @ if 1 swap +! else drop then ;
-\ re-define colon
-: : :
- here 2 allot postpone literal postpone profiler
-;
-
-\ get the address of the profiling data.
-: xt>prf ( xt -- addr )
- cell+ @i
-;
-
-\ useful stuff
-: .prf xt>prf @ u. ;
-: prf-reset xt>prf 0 swap ! ;
-
-\ usage
-\ : foo bar baz ;
-\ profile:on -- turn on profiling
-\ ' foo .prf -- gets the number of calls to foo
-\ ' foo prf-reset -- resets this number
-\ profile:off -- turn off profiling
-\ wanna profile system words? just re-define them now ;)
-\ e.g. : + + ;