Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Bench-suite wrapper around hammertime module.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.jshintrc
.npmignore
.travis.yml
CHANGELOG.md
README.md
package.json

README.md

Build Status NPM version

Anvil

A lightweight bench-suite module for hammertime.

Usage

var anvil = require('anvil');

anvil('sword vs spear', function (forge, hammer) {
    forge.after(function (error, results) {
        results.forEach(function (report) {
            console.log('%s: %d operations/second.', report.name, report.ops);
        });
    });

    forge.add('sword', function () {
        ...
    });

    forge.add('spear', function () {
        ...
    });

    hammer();
});

Async

Just pass a callback to do async.

forge.add('spear', function (next) {
    ...
    next();
});

API

anvil takes a description and invokes the supplied callback with a forge and a hammer.

forge

  • before - function to call as a suite setup. Receives next callback.
  • after - function to call as a suite tear-down / report analysis. Receives error and results.
  • beforeEach - called before each suite item runs. Receives next callback, which can accept an error argument.
  • afterEach - called after each suite item runs. Receives next callback, which can accept an error argument.

Begin by calling hammer.

Something went wrong with that request. Please try again.