# FormatTime

> 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.

## Definition

* **Type:** Method
* **Namespace:** [Unity.ProjectAuditor.Editor.Utils](/engine/6000.6/script-reference/unity/projectauditor/editor/utils.md)
* **Assembly:** UnityEditor

## FormatTime(TimeSpan)

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.

```csharp
public static string FormatTime(TimeSpan timeSpan)
```

### Parameters

**** (\[TimeSpan]\(https\://learn.microsoft.com/dotnet/api/system.timespan)): The TimeSpan object to format.

### Returns

| Type                                                           | Description                                           |
| -------------------------------------------------------------- | ----------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | A string representation of the input TimeSpan object. |

## FormatTime(float)

Formats a given time value as a string in the format "X ms", "X s", or "X min"

```csharp
public static string FormatTime(float timeMs)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The time value to format, in milliseconds.

### Returns

| Type                                                           | Description                                       |
| -------------------------------------------------------------- | ------------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | A string representation of the input float value. |
