OpenTAP 9.25
API Reference
Static Public Member Functions | List of all members
OpenTap.TimeSpanFormatter Class Reference

Contains helper functions to format a time span into a human readable string. More...

Static Public Member Functions

static string Format (TimeSpan timespan, FormatVerbosities verbosity=FormatVerbosities.Normal, bool unitSpacer=true, bool includeZeros=true, bool includeSplitSeconds=true, CultureInfo numberFormatCulture=null)
 Formats a timespan to a string like "3 min 4 sec". More...
 

Detailed Description

Contains helper functions to format a time span into a human readable string.

Member Function Documentation

◆ Format()

static string OpenTap.TimeSpanFormatter.Format ( TimeSpan  timespan,
FormatVerbosities  verbosity = FormatVerbosities.Normal,
bool  unitSpacer = true,
bool  includeZeros = true,
bool  includeSplitSeconds = true,
CultureInfo  numberFormatCulture = null 
)
inlinestatic

Formats a timespan to a string like "3 min 4 sec".

Parameters
timespanThe timespan.
verbosityThe verbosity.
unitSpacertrue to insert a space before each unit.
includeZerostrue to include those parts of the timespan that are zero, starting with hours, e.g. "0h 2m 0s" instead of just "2m".
includeSplitSecondstrue to include, false to exclude the fractions of the second portion.
numberFormatCultureThe Culture to use for number formatting. Since milliseconds are displayed as fractions of seconds, this effects the decimal delimiter. By default, the DefaultThreadCurrentCulture is used.
Returns
The formatted value.

OpenTAP 9.25 API built Tue Aug 6 2024 07:49:24