Skip to content

joshfarrant/drag-race

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drag-race

A simple JavaScript code execution speed test.

Drag race takes a given array of functions and runs them all with the arguments provided. It times the execution of each function, and then prints the ordered results to the console.

Drag Race example

Installation

git clone git@github.com:joshfarrant/drag-race.git
npm install

Usage

To use Drag Race simply require it, define an array of functions to test, and call the dragRace() function.

The dragRace() function takes the number of times to run the test as the first parameter, your array of functions as the second parameter, and any arguments to be passed to each function as further parameters.

dragRace(timesToRun, funcArray, arg1, arg2, arg3, etc...);
const dragRace = require('drag-race');

// Array of functions to test
const functions = [
  function myFunc1(arg1, arg2) {
    /*
      ...
    */
  },
  function myFunc2(arg1, arg2) {
    /*
      ...
    */
  }
];

dragRace(timesToRun, functions, arg1, arg2);

About

A simple JavaScript code execution speed test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published