Analysis-Services/ASJobGraphEvents/gantt/utility.py
Sam f9ddc12a9b
Adds Gantt Charts (#63)
* added gantt charts
* removed .pycache
* updated for newer versions of the event

Co-authored-by: t-saste <t-saste@STEVENS-HEKA-1>
2020-07-29 10:10:49 -07:00

17 lines
416 B
Python

from datetime import datetime
from gantt_types import Millisecond, Second
def duration_ms(start_time: datetime, end_time: datetime) -> Millisecond:
duration = end_time - start_time
return Millisecond((duration.seconds * 1000000 + duration.microseconds) // 1000)
def ms_to_s(m: Millisecond) -> Second:
return Second(m / 1000)
def s_to_ms(s: Second) -> Millisecond:
return Millisecond(s * 1000)