https://github.com/stuhlmueller/webppl-timeit
Measure execution time of webppl functions
https://github.com/stuhlmueller/webppl-timeit
timing webppl
Last synced: 6 months ago
JSON representation
Measure execution time of webppl functions
- Host: GitHub
- URL: https://github.com/stuhlmueller/webppl-timeit
- Owner: stuhlmueller
- Created: 2016-01-18T02:39:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-18T03:27:20.000Z (over 10 years ago)
- Last Synced: 2025-11-02T14:37:48.266Z (8 months ago)
- Topics: timing, webppl
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 upgrade to the latest version, run:
npm install --prefix ~/.webppl webppl-timeit --force
## Usage
Once installed, you can make `timeit` available to `program.wppl` by running:
webppl program.wppl --require webppl-timeit
## License
MIT