corth-lang / Corth

A self-hosted stack based language like Forth
MIT License
7 stars 1 forks source link

`timeit` standard library #49

Closed HuseyinSimsek7904 closed 6 months ago

HuseyinSimsek7904 commented 6 months ago

A standard library to time pieces of code is required.

timeit:init  // initializes the timer

  0 while dup 1000 < do
    "Hello, world!\n" puts
  inc end drop

timeit:_end  // returns the time elapsed and deinitializes the timer
...  // do something with the time value