feat: display screen resolution, content stats, and advanced metrics on dashboard
This commit is contained in:
14
lib/utils/format_extra.ts
Normal file
14
lib/utils/format_extra.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Format duration in seconds to "1m 30s" or "30s"
|
||||
*/
|
||||
export function formatDuration(seconds: number): string {
|
||||
if (!seconds) return '0s'
|
||||
|
||||
const m = Math.floor(seconds / 60)
|
||||
const s = Math.floor(seconds % 60)
|
||||
|
||||
if (m > 0) {
|
||||
return `${m}m ${s}s`
|
||||
}
|
||||
return `${s}s`
|
||||
}
|
||||
Reference in New Issue
Block a user