Module: utils/util

Methods

(static) bench(time) → {Array}

Return hrtime (shim for browser).

Parameters:
Name Type Description
time Array
Source:
Returns:

[seconds, nanoseconds]

Type
Array

(static) date(timenullable) → {String}

Create a Date ISO string from time in unix time (seconds).

Parameters:
Name Type Attributes Description
time Number <nullable>

Seconds in unix time.

Source:
Returns:
Type
String

(static) ms() → {Number}

Get current time in unix time (milliseconds).

Source:
Returns:
Type
Number

(static) now() → {Number}

Get current time in unix time (seconds).

Source:
Returns:
Type
Number

(static) revHex(buf) → {String}

Reverse a hex-string.

Parameters:
Name Type Description
buf Buffer
Source:
Returns:

Reversed hex string.

Type
String

(static) time(datenullable) → {Number}

Get unix seconds from a Date string.

Parameters:
Name Type Attributes Description
date String <nullable>

Date ISO String.

Source:
Returns:
Type
Number