UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

12 lines (11 loc) 278 B
export function formatMilliseconds(ms) { if (ms < 0) { throw new Error("Milliseconds cannot be negative"); } if (ms < 1e3) { return `${ms}ms`; } const seconds = Math.floor(ms / 1e3); const milliseconds = ms % 1e3; return `${seconds}s ${milliseconds}ms`; }