MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatMilliseconds

Function formatMilliseconds

packages/arctic/src/provider/usage.ts:551–567  ·  view source on GitHub ↗
(ms: number)

Source from the content-addressed store, hash-verified

549 }
550
551 function formatMilliseconds(ms: number): string {
552 const seconds = Math.floor(ms / 1000)
553 const minutes = Math.floor(seconds / 60)
554 const hours = Math.floor(minutes / 60)
555 const days = Math.floor(hours / 24)
556
557 if (days > 0) {
558 return `${days}d ${hours % 24}h`
559 }
560 if (hours > 0) {
561 return `${hours}h ${minutes % 60}m`
562 }
563 if (minutes > 0) {
564 return `${minutes}m ${seconds % 60}s`
565 }
566 return `${seconds}s`
567 }
568
569 async function ensureAnthropicAccessToken(auth: Extract<Auth.Info, { type: "oauth" }>, providerID: string): Promise<string> {
570 let token = auth.access

Callers 1

fetchMinimaxUsageLimitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected