0.3.0 • Published 8 years ago

webppl-timeit v0.3.0

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

webppl-timeit

This package provides a function timeit that takes a thunk and returns an object with its return value and its runtime in milliseconds. For example,

timeit(function(){
  var x = 1;
  sleep(750);
  return x;
})

returns

{ value: 1,
  runtimeInMilliseconds: 751 }

Installation

To globally install webppl-timeit, run:

mkdir -p ~/.webppl
npm install --prefix ~/.webppl webppl-timeit

This may print warnings (npm WARN ENOENT...) which can be ignored.

To update to the latest version, run:

npm update --prefix ~/.webppl webppl-timeit

Usage

Once installed, you can make timeit available to program.wppl by running:

webppl program.wppl --require webppl-timeit

License

MIT

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago