summaryrefslogtreecommitdiffstats
path: root/src/forth/interp.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-08-23 12:16:01 -0400
committerBrian Cully <bjc@spork.org>2025-08-23 12:16:01 -0400
commit8ce858ce7a03090b3b2a1310d17b1206f097637f (patch)
tree1cfffdd378abc49f4d1f737b76a83f76224a14c8 /src/forth/interp.rs
parent5b8962e35836cf7ccbfdbca312f6b0eb9269e2a6 (diff)
downloadautomathon-8ce858ce7a03090b3b2a1310d17b1206f097637f.tar.gz
automathon-8ce858ce7a03090b3b2a1310d17b1206f097637f.zip
add some benchmarking
Diffstat (limited to 'src/forth/interp.rs')
-rw-r--r--src/forth/interp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/forth/interp.rs b/src/forth/interp.rs
index e41f0d9..512c022 100644
--- a/src/forth/interp.rs
+++ b/src/forth/interp.rs
@@ -216,9 +216,10 @@ impl Interp {
Ok(self.ip.offset < self.wordlist.0[self.ip.word].len())
}
- pub fn run(&mut self) -> Result<(), RuntimeError> {
- while self.tick()? {}
- Ok(())
+ pub fn run(&mut self) -> Result<usize, RuntimeError> {
+ let mut count = 0;
+ while self.tick()? { count += 1 }
+ Ok(count)
}
}