feat: fun little program
This commit is contained in:
@@ -44,15 +44,20 @@ func main() {
|
||||
fmt.Println(lambda.Stringify(compiled))
|
||||
}
|
||||
|
||||
steps := 0
|
||||
|
||||
for lambda.ReduceOnce(&compiled) {
|
||||
logger.Info("reduction", "tree", lambda.Stringify(compiled))
|
||||
if options.Explanation {
|
||||
fmt.Println(" =", lambda.Stringify(compiled))
|
||||
}
|
||||
steps++
|
||||
}
|
||||
|
||||
elapsed := time.Since(start).Milliseconds()
|
||||
|
||||
fmt.Println(lambda.Stringify(compiled))
|
||||
fmt.Fprintln(os.Stderr, "Time Spent:", elapsed, "ms")
|
||||
fmt.Fprintln(os.Stderr, "Steps:", steps)
|
||||
fmt.Fprintln(os.Stderr, "Speed:", float32(steps)/(float32(elapsed)/1000), "ops")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user