(timeUnit: string)
| 185 | }; |
| 186 | |
| 187 | export function convertTimeUnitToShortTerm(timeUnit: string) { |
| 188 | if (timeUnit === 'microseconds') return 'μs'; |
| 189 | |
| 190 | const shortTimeUnit = (timeUnitToShortTermMapper as any)[timeUnit]; |
| 191 | |
| 192 | if (shortTimeUnit) return shortTimeUnit; |
| 193 | |
| 194 | return ''; |
| 195 | } |
| 196 | |
| 197 | export function convertToTimeUnit(microseconds: number, targetTimeUnit: string) { |
| 198 | if (microseconds < 1000) { |