avTimer
Multiple timers in single instance to measure repetitive events performance
usage
Grab it from npm and use with your favorite bundler:
npm install avtimer --save
Or download from CDN:
<script src='https://cdn.rawgit.com/anvaka/avtimer/v1.0.0/dist/avtimer.min.js'></script>
If you downloaded from CDN the library will be available under avTimer global name.
var stopIteratorTimer = avTimer('Iterate over binary tree');
stopIteratorTimer();
avTimer.print();
avTimer.print('Iterate over binary tree');
Motivation
Most of the time using performance profiling tools in your favorite browser should
be better than using this library. However this library can be useful if you want
to track performance of two code branches, that call shared functionality.
In my case I needed to traverse quad tree in multiple code paths, multiple event
loop cycles. I was not sure which code path was more expensive. Performance
profiler was showing that tree iterator was the slowest, but I couldn't figure
out which code path to keep.
license
MIT