Skip to content

@k8slens/extensions

Globals / "src/renderer/utils/formatDuration"

Module: "src/renderer/utils/formatDuration"#

Index#

Variables#

Functions#

Variables#

suffixes#

Const suffixes: string[] = ["w", "d", "h", "m", "s"]

Defined in src/renderer/utils/formatDuration.ts:3

Functions#

formatDuration#

formatDuration(timeValue: number, compact: boolean): string

Defined in src/renderer/utils/formatDuration.ts:10

This function formats durations in a more human readable form.

Parameters:

Name Type Description
timeValue number the duration in milliseconds to format
compact boolean when true, only the largest non-zero time frame will be returned

Returns: string


Last update: November 10, 2020