Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "utils"

This module contains runtime time counting utilities, i.e. objects that are able to measure the duration of operations during execution.

Such objects are capable of counting between arbitrary start and stop points in time. The results are all based on time objects.

Employ one of the following snippets to use it in your project:

  • EcmaScript 6 or equivalent:
    import { BasicTimer, StopWatch, Timer } from "timecount/utils";
    
  • Older EcmaScripts:
    var localization = require("timecount").utils;
    // -or
    var timecount = require("timecount/utils");
    

💡 The exported function getProcessTime is equivalent to Node's process.hrtime.bigint, except it returns the big decimal from decimal.js instead of the library used by Node.

Index

Type aliases

StopWatchDetail

StopWatchDetail: (partialTimes: Time[], error: number) => void

This type of function is used by stopwatches to return additional information to the callers of stop

Type declaration

    • (partialTimes: Time[], error: number): void
    • Parameters

      • partialTimes: Time[]
      • error: number

      Returns void

Functions

getProcessTime

  • getProcessTime(): Decimal
  • Gets the number of nanoseconds that represent the current time according to process.

    Returns Decimal

    Big decimal representation of the current time, in nanoseconds.

Generated using TypeDoc