Skip to content

Commit a38a1f8

Browse files
authored
add start epoch time to TorchXEvent
Differential Revision: D56037935 Pull Request resolved: #882
1 parent 8a18b70 commit a38a1f8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

torchx/runner/events/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,12 @@ def __init__(
9191
)
9292
self._start_cpu_time_ns = 0
9393
self._start_wall_time_ns = 0
94+
self._start_epoch_time_usec = 0
9495

9596
def __enter__(self) -> "log_event":
9697
self._start_cpu_time_ns = time.process_time_ns()
9798
self._start_wall_time_ns = time.perf_counter_ns()
99+
self._start_epoch_time_usec = int(time.time() * 1000)
98100
return self
99101

100102
def __exit__(

torchx/runner/events/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TorchxEvent:
4646
source: SourceType = SourceType.UNKNOWN
4747
cpu_time_usec: Optional[int] = None
4848
wall_time_usec: Optional[int] = None
49+
start_epoch_time_usec: Optional[int] = None
4950

5051
def __str__(self) -> str:
5152
return self.serialize()

0 commit comments

Comments
 (0)