speedIndex

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.perf

This function gives you back an index usually between 0 and 100 that represent the speed estimation of the computer on which this code runs. This index is calculated by estimating the loops (for) count that the computer can make in 100ms and make use of the “slow” and “fast” parameters that represent an average of how many loops a “slow” computer can do in this timeframe, vs how many loops a “fast” computer can make in this timeframe. You can totally update these parameters as you prefer. Note that these parameters can/will be updated during time to reflect the most average cases possible.

Params

  1. slow100000Number

    How many loops a “slow” computer can make in 100ms

  2. fast1400000Number

    How many loops a “fast” computer can make in 100ms

Return

  1. -Number

    The speed index calculated from the passed params and the loops the computer can make in 100ms

Example

import { speedIndex } from '@blackbyte/sugar/perf';
speedIndex(); // 78

Todo

  • testsnormal