MCPcopy Create free account
hub / github.com/mlco2/codecarbon / Time

Class Time

codecarbon/core/units.py:11–25  ·  view source on GitHub ↗

Measured in seconds

Source from the content-addressed store, hash-verified

9
10@dataclass
11class Time:
12 """
13 Measured in seconds
14 """
15
16 seconds: float
17 SECONDS_TO_HOURS = 1 / 3600
18
19 @property
20 def hours(self) -> float:
21 return self.seconds * Time.SECONDS_TO_HOURS
22
23 @classmethod
24 def from_seconds(cls, seconds: float) -> "Time":
25 return cls(seconds=seconds)
26
27
28@dataclass

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…