Gemstone Common Library
Show/Hide TOC

# TicksToElapsedTimeString(Int32, String, Double) Method

Converts the Ticks value into a textual representation of years, days, hours, minutes and seconds with the specified number of fractional digits given string array of time names.

## Definition

Namespace: Gemstone
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.159 -- Release Build+a612c25bc0e1c87e5766544ec4650d2ebcfddcf4
C#
View Source Request Example

    public string ToElapsedTimeString(
    	int secondPrecision,
    	string[] timeNames,
    	double minimumSubSecondResolution = 0.001
    )

VB
View Source Request Example

    Public Function ToElapsedTimeString (
    	secondPrecision As Integer,
    	timeNames As String(),
    	Optional minimumSubSecondResolution As Double = 0.001
    ) As String

C++
View Source Request Example

    public:
    String^ ToElapsedTimeString(
    	int secondPrecision,
    	array<String^>^ timeNames,
    	double minimumSubSecondResolution = 0.001
    )

JavaScript
View Source Request Example

    function ToElapsedTimeString(secondPrecision, timeNames, minimumSubSecondResolution);

#### Parameters

secondPrecision Int32
  Number of fractional digits to display for seconds.
timeNames String
  Time names array to use during textual conversion.
minimumSubSecondResolution Double (Optional)
  Minimum sub-second resolution to display. Defaults to Milli.

#### Return Value

String
The string representation of the value of this instance, consisting of the number of years, days, hours, minutes and seconds represented by this value.

## Remarks

Set secondPrecision to -1 to suppress seconds display, this will force minimum resolution of time display to minutes.

timeNames array needs one string entry for each of the following names:
" year", " years", " day", " days", " hour", " hours", " minute", " minutes", " second", " seconds", "less than ".

## Exceptions

ArgumentOutOfRangeException | minimumSubSecondResolution is not less than or equal to Milli or minimumSubSecondResolution is not defined in Factors array.

## See Also

#### Reference

Ticks Structure
ToElapsedTimeString Overload
Gemstone Namespace