MCPcopy
hub / github.com/darkreader/darkreader / getDuration

Function getDuration

src/utils/time.ts:103–118  ·  view source on GitHub ↗
(time: Duration)

Source from the content-addressed store, hash-verified

101}
102
103export function getDuration(time: Duration): number {
104 let duration = 0;
105 if (time.seconds) {
106 duration += time.seconds * 1000;
107 }
108 if (time.minutes) {
109 duration += time.minutes * 60 * 1000;
110 }
111 if (time.hours) {
112 duration += time.hours * 60 * 60 * 1000;
113 }
114 if (time.days) {
115 duration += time.days * 24 * 60 * 60 * 1000;
116 }
117 return duration;
118}
119
120export function getDurationInMinutes(time: Duration): number {
121 return getDuration(time) / 1000 / 60;

Callers 14

watchForNodePositionFunction · 0.90
deepWatchForInlineStylesFunction · 0.90
runWakeDetectorMethod · 0.90
config-manager.tsFile · 0.90
LimitedCacheStorageClass · 0.90
keepHopeAliveFunction · 0.90
BodyFunction · 0.90
isFreshFunction · 0.90
time.tests.tsFile · 0.90
getDurationInMinutesFunction · 0.85
getSunsetSunriseUTCTimeFunction · 0.85
getTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected