From 8ce858ce7a03090b3b2a1310d17b1206f097637f Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sat, 23 Aug 2025 12:16:01 -0400 Subject: add some benchmarking --- src/forth/interp.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/forth') 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 { + let mut count = 0; + while self.tick()? { count += 1 } + Ok(count) } } -- cgit v1.3