nose-pluto/bin/uptime.ts
2025-09-29 21:18:39 -07:00

15 lines
383 B
TypeScript

// How long has the NOSE app been running?
//
// Totally different from the host computer's uptime. Usually.
import { NOSE_STARTED } from "@/config"
export default function () {
const ms = Date.now() - NOSE_STARTED
const sec = Math.floor(ms / 1000)
const min = Math.floor(sec / 60)
const hrs = Math.floor(min / 60)
return `${hrs}h ${min % 60}m ${sec % 60}s`
}