|
TimeToElapsedTimeString Method
|
Converts total seconds into a textual representation of years, days, hours,
minutes and seconds with the specified number of fractional digits given string array of
time names.
Namespace: GSF.UnitsAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax public static string ToElapsedTimeString(
double seconds,
int secondPrecision,
string[] timeNames = null,
double minimumSubSecondResolution = 0.001
)
Public Shared Function ToElapsedTimeString (
seconds As Double,
secondPrecision As Integer,
Optional timeNames As String() = Nothing,
Optional minimumSubSecondResolution As Double = 0.001
) As String
public:
static String^ ToElapsedTimeString(
double seconds,
int secondPrecision,
array<String^>^ timeNames = nullptr,
double minimumSubSecondResolution = 0.001
)
static member ToElapsedTimeString :
seconds : float *
secondPrecision : int *
?timeNames : string[] *
?minimumSubSecondResolution : float
(* Defaults:
let _timeNames = defaultArg timeNames null
let _minimumSubSecondResolution = defaultArg minimumSubSecondResolution 0.001
*)
-> string
GSF.Units.Time.ToElapsedTimeString = function(seconds, secondPrecision, timeNames, minimumSubSecondResolution);
View SourceParameters
- seconds Double
- Seconds to convert to elapsed time.
- secondPrecision Int32
- Number of fractional digits to display for seconds.
- timeNames String (Optional)
- 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.
Exceptions 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 ".
See Also