2020-12-06 13:03:40 -08:00
|
|
|
|
---
|
|
|
|
|
id: executiontime
|
|
|
|
|
title: Execution Time
|
|
|
|
|
sidebar_label: Execution Time
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## What
|
|
|
|
|
|
|
|
|
|
Displays the execution time of the previously executed command.
|
|
|
|
|
|
|
|
|
|
## Sample Configuration
|
|
|
|
|
|
2023-03-31 11:55:36 -07:00
|
|
|
|
import Config from '@site/src/components/Config.js';
|
|
|
|
|
|
|
|
|
|
<Config data={{
|
2020-12-06 13:03:40 -08:00
|
|
|
|
"type": "executiontime",
|
|
|
|
|
"style": "powerline",
|
|
|
|
|
"powerline_symbol": "\uE0B0",
|
|
|
|
|
"foreground": "#ffffff",
|
|
|
|
|
"background": "#8800dd",
|
2023-05-09 02:08:45 -07:00
|
|
|
|
"template": " <#fefefe>\ueba2</> {{ .FormattedMs }} ",
|
2020-12-06 13:03:40 -08:00
|
|
|
|
"properties": {
|
|
|
|
|
"threshold": 500,
|
2023-05-22 06:29:26 -07:00
|
|
|
|
"style": "austin",
|
|
|
|
|
"always_enabled": true
|
2020-12-06 13:03:40 -08:00
|
|
|
|
}
|
2023-03-31 11:55:36 -07:00
|
|
|
|
}}/>
|
2020-12-06 13:03:40 -08:00
|
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
| ---------------- | --------- | ----------------------------------------------------------------------------------- |
|
|
|
|
|
| `always_enabled` | `boolean` | always show the duration - defaults to `false` |
|
|
|
|
|
| `threshold` | `number` | minimum duration (milliseconds) required to enable this segment - defaults to `500` |
|
|
|
|
|
| `style` | `enum` | one of the available format options - defaults to `austin` |
|
2020-12-10 07:02:45 -08:00
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
|
### Style
|
2020-12-10 07:02:45 -08:00
|
|
|
|
|
|
|
|
|
Style specifies the format in which the time will be displayed. The table below shows some example times in each option.
|
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
|
| format | 0.001s | 2.1s | 3m2.1s | 4h3m2.1s |
|
|
|
|
|
| ------------- | -------------- | -------------- | -------------- | ---------------- |
|
|
|
|
|
| `austin` | `1ms` | `2.1s` | `3m 2.1s` | `4h 3m 2.1s` |
|
|
|
|
|
| `roundrock` | `1ms` | `2s 100ms` | `3m 2s 100ms` | `4h 3m 2s 100ms` |
|
|
|
|
|
| `dallas` | `0.001` | `2.1` | `3:2.1` | `4:3:2.1` |
|
|
|
|
|
| `galveston` | `00:00:00` | `00:00:02` | `00:03:02` | `04:03:02` |
|
|
|
|
|
| `galvestonms` | `00:00:00:001` | `00:00:02:100` | `00:03:02:100` | `04:03:02:100` |
|
|
|
|
|
| `houston` | `00:00:00.001` | `00:00:02.1` | `00:03:02.1` | `04:03:02.1` |
|
|
|
|
|
| `amarillo` | `0.001s` | `2.1s` | `182.1s` | `14,582.1s` |
|
|
|
|
|
| `round` | `1ms` | `2s` | `3m 2s` | `4h 3m` |
|
2023-06-27 04:07:44 -07:00
|
|
|
|
| `lucky7` | ` 1ms` | ` 2.00s ` | ` 3m 2s` | ` 4h 3m` |
|
2021-11-14 02:04:31 -08:00
|
|
|
|
|
2022-02-01 03:10:46 -08:00
|
|
|
|
## Template ([info][templates])
|
|
|
|
|
|
|
|
|
|
:::note default template
|
|
|
|
|
|
2022-07-21 04:38:07 -07:00
|
|
|
|
```template
|
2022-02-01 03:10:46 -08:00
|
|
|
|
{{ .FormattedMs }}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
|
|
### Properties
|
2021-11-14 02:04:31 -08:00
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
| -------------- | -------- | ---------------------------------------------- |
|
|
|
|
|
| `.Ms` | `number` | the execution time in milliseconds |
|
|
|
|
|
| `.FormattedMs` | `string` | the formatted value based on the `style` above |
|
2022-01-22 10:46:56 -08:00
|
|
|
|
|
2022-04-20 09:43:59 -07:00
|
|
|
|
[templates]: /docs/configuration/templates
|