From c77363a4cfc1df05671abb7a080504704e97936d Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 5 Oct 2017 20:41:06 +0200 Subject: remove ticker --- eval.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'eval.go') diff --git a/eval.go b/eval.go index 361bf35..3f1cb8b 100644 --- a/eval.go +++ b/eval.go @@ -5,7 +5,6 @@ import ( "encoding/binary" "fmt" "io/ioutil" - "time" ) // J1 Forth processor VM @@ -44,18 +43,13 @@ func (j1 *J1) LoadFile(fname string) error { // Eval evaluates content of memory func (j1 *J1) Eval() { - var cycle int - ticker := time.NewTicker(time.Second / 10) - defer ticker.Stop() - for range ticker.C { - cycle++ + for n := 0; ; n++ { ins := Decode(j1.memory[j1.pc]) if ins == Jump(0) { return } j1.eval(ins) - fmt.Printf("%4d %v\n", cycle, ins) - fmt.Printf("%v\n", j1) + fmt.Printf("%4d %v\n%v\n", n, ins, j1) } } -- cgit v1.2.3