speedtest.cmn 540 B

12345678910111213141516171819202122232425262728293031323334
  1. # small test for the speed of execution
  2. 0 10 "computing, hold on..." -->
  3. N: 12345678 . # iterations
  4. 123 # start value
  5. N
  6. @'
  7. $0 +x100000 % 0 = ?
  8. "9" $1 10 * N / - -> 0 10 "0%" -->
  9. .
  10. ><
  11. # TESTED OPERATION HERE:
  12. $0 10000 < ? $0 2 + >< 8000 >< 7 * ++ / + ; 9000 - .
  13. # ^this expression in C: (x < 10000 ? (x + 2 + 8000 / (7 * x + 1)) : (x - 9000))
  14. ><
  15. --
  16. .
  17. ^
  18. # print result, to prevent optimizations:
  19. $0 1000 / 10 % "0" + ->
  20. $0 100 / 10 % "0" + ->
  21. $0 10 / 10 % "0" + ->
  22. 10 % "0" + ->
  23. 10 ->
  24. 0 10 "done" -->