nose-pluto/bin/uptime.ts
2025-10-06 19:30:26 -07:00

15 lines
434 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)
const days = Math.floor(hrs / 24)
return `${days}d ${hrs % 24}h ${min % 60}m ${sec % 60}s`
}