Download next.js/packages/next/src/build/duration-to-string.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/duration-to-string.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next/src/build/duration-to-string.ts
-
curl -L -o duration-to-string.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next/src/build/duration-to-string.ts
469 Bytes
| export function durationToString(compilerDuration: number) { | |
| let durationString | |
| if (compilerDuration > 120) { | |
| durationString = `${(compilerDuration / 60).toFixed(1)}min` | |
| } else if (compilerDuration > 40) { | |
| durationString = `${compilerDuration.toFixed(0)}s` | |
| } else if (compilerDuration > 2) { | |
| durationString = `${compilerDuration.toFixed(1)}s` | |
| } else { | |
| durationString = `${(compilerDuration * 1000).toFixed(0)}ms` | |
| } | |
| return durationString | |
| } | |