Skip to content

Instantly share code, notes, and snippets.

@Yardanico
Created January 27, 2020 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yardanico/19f841ce642148f6763b8769729ab366 to your computer and use it in GitHub Desktop.
Save Yardanico/19f841ce642148f6763b8769729ab366 to your computer and use it in GitHub Desktop.
import mathexpr
import std / [times, monotimes, stats]
var r: RunningStat
for iterations in 1..5:
let start = getMonoTime()
let e = newEvaluator()
for i in 0 ..< 1000000:
let r = e.eval("100^---+-++---++-+-+-.5+1 + --(1e2^(+(-(-(-.5e0))))+1e0)")
if r != 12.1:
quit(0)
r.push float((getMonoTime() - start).inMilliseconds)
echo r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment