Skip to content

stuhlmueller/webppl-timeit

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

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

About

Measure execution time of webppl functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published