---
title: "formatTime"
canonical: "https://help.vicon.com/space/Shogun111/13207860/formatTime"
format: markdown
---
# Description

Converts a system time integer into a human-readable text representation.

## Functional area

System

# Command syntax

## Syntax

|  |
| --- |
| `formatTime time` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `time` | int | yes | System time previously obtained using [getSystemTime](https://vicon-help.atlassian.net/wiki/spaces/Shogun111/pages/13208114). |

### Flags

None

## Return value

string

## Examples

```plaintext
// Calculate how long it takes to go through a 1,000,000
// iteration loop. It's about 3 seconds on a 3ghz machine.
int $i, $startTime, $endTime;
string $timeStr;
 
// Get the start time
$startTime = `getSystemTime`;
$timeStr = `formatTime $startTime`;
print $timeStr;
 
// Do an empty, lengthy loop
while( $i < 1000000 ){ $i += 1;}
```

> Macro (scroll-pagebreak)

```plaintext
// Get the end time
$endTime = `getSystemTime`;
$timeStr = `formatTime $endTime`;
print $timeStr;
 
// Now get the execution time
print int( $endTime - $startTime );
```

# Additional information

## Related commands

- [getSystemTime](https://vicon-help.atlassian.net/wiki/spaces/Shogun111/pages/13208114)
- [system](https://vicon-help.atlassian.net/wiki/spaces/Shogun111/pages/13208612)