diff --git a/renderer/components/DNav.tsx b/renderer/components/DNav.tsx index 1e81a2c0..2e23ed29 100644 --- a/renderer/components/DNav.tsx +++ b/renderer/components/DNav.tsx @@ -34,6 +34,7 @@ type Props = StateProps & OwnProps; const LOW_LATENCY_THRESHOLD_MSEC = 200; const HIGH_LATENCY_THRESHOLD_MSEC = 300; +const MSEC_IN_ONE_SECOND = 1000; /** * 3 Icons at the top right of Dawn: Tour, RobotIP, Upload @@ -60,6 +61,15 @@ const DNavComponent = (props: Props) => { } } + const formatLatencyValue = (latency: number) => { + if (latency > MSEC_IN_ONE_SECOND) { + latency = latency / MSEC_IN_ONE_SECOND; + return `${latency} sec`; + } + + return `${latency} ms`; + } + const { connectionStatus, runtimeStatus, @@ -112,7 +122,7 @@ const DNavComponent = (props: Props) => { /> - +