Socket
Book a DemoInstallSign in
Socket

yunofast

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yunofast

super light benchmarking tool designed to leave in long running server code.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Build Status

yunofast

super light benchmarking tool designed to leave in long running server code.

example

var bench = require('yunofast')

var b = bench();

var c = 0;
(function fn(){
  c++;

  b.start('test');
  setTimeout(function(){
    b.end('test');
    if(c < 150) fn();
    else console.log(b.report());
  },10+(+((''+Math.random()).substr(4,2))));

}());

api

bench()

  • returns new benchmark object

bench.start(key)

  • start a timer for key

bench.end(key) / bench.stop(key)

  • stop a timer for a key

bench.report()

  • return a summary report of all keys

bench.remove(key)

  • drop all marks for key

report output

{ test:
   { count: 60,
     avg: 0.05,
     slidingAvg: 0.0682593545,
     total: [ 3, 906278613 ] } }

woo hoo

let me know if you have any issues or this is useful.

Keywords

bench

FAQs

Package last updated on 19 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts