Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Declaration
public static string FormatTime(TimeSpan timeSpan);
Parameters
| Parameter |
Description |
| timeSpan |
The TimeSpan object to format. |
Returns
string
A string representation of the input TimeSpan object.
Description
Formats a given TimeSpan object as a string in the format "X ms", "X s", or "X min", depending on the length of the time span.
Declaration
public static string FormatTime(float timeMs);
Parameters
| Parameter |
Description |
| timeMs |
The time value to format, in milliseconds. |
Returns
string
A string representation of the input float value.
Description
Formats a given time value as a string in the format "X ms", "X s", or "X min"