Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Resolved conflicts by taking GitHub versions for: - .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml Kept deploy.sh updated to: - Pull from GitHub (primary source) - Push to Gitea (push-mirror) - Build from site/ directory (GitHub structure) Co-Authored-By: Paperclip <noreply@paperclip.ing>
37 lines
1.8 KiB
TypeScript
37 lines
1.8 KiB
TypeScript
/**
|
|
* Converts a duration in seconds to a human-readable string format.
|
|
* Formats duration based on magnitude for optimal readability:
|
|
* - >= 2 minutes: show in minutes with 1 decimal place (e.g., "2.5min")
|
|
* - >= 40 seconds: show in whole seconds (e.g., "45s")
|
|
* - >= 2 seconds: show in seconds with 1 decimal place (e.g., "3.2s")
|
|
* - < 2 seconds: show in whole milliseconds (e.g., "1500ms")
|
|
*
|
|
* @deprecated Use durationToStringWithNanoseconds instead, collect time in nanoseconds using process.hrtime.bigint().
|
|
* @param compilerDuration - Duration in seconds as a number
|
|
* @returns Formatted duration string with appropriate unit and precision
|
|
*/
|
|
export declare function durationToString(compilerDuration: number): string;
|
|
/**
|
|
* Converts a high-resolution time tuple to seconds.
|
|
*
|
|
* @param hrtime - High-resolution time tuple of [seconds, nanoseconds]
|
|
* @returns Duration in seconds as a floating-point number
|
|
*/
|
|
export declare function hrtimeToSeconds(hrtime: [number, number]): number;
|
|
/**
|
|
* Converts a BigInt nanosecond duration to a human-readable string format.
|
|
* This is the preferred method for formatting high-precision durations.
|
|
*
|
|
* @param hrtime - Duration in nanoseconds as a BigInt (typically from process.hrtime.bigint())
|
|
* @returns Formatted duration string with appropriate unit and precision
|
|
*/
|
|
export declare function hrtimeBigIntDurationToString(hrtime: bigint): string;
|
|
/**
|
|
* Converts a high-resolution time tuple to a human-readable string format.
|
|
*
|
|
* @deprecated Use hrtimeBigIntDurationToString with process.hrtime.bigint() for better precision.
|
|
* @param hrtime - High-resolution time tuple of [seconds, nanoseconds]
|
|
* @returns Formatted duration string with appropriate unit and precision
|
|
*/
|
|
export declare function hrtimeDurationToString(hrtime: [number, number]): string;
|