[WebUI] Add chrome.timeTicks.nowInMicroseconds() to WebUI
Add chrome.timeTicks.nowInMicroseconds() to WebUI. It returns the microseconds since the origin of TimeTicks as a BigInt. It is equivalent of TimeTicks::Now().since_origin().InMicroseconds() in C++. This function will facilitate calculating delta between TimeTicks captured in browser and WebUI. This is currently not possible because time units in JS (performance.now, Date) use different origins from TimeTicks. See more discussion in doc: go/timeticks-in-webui Note: We can't expose TimeTicks's raw value as chrome.timeTicks.now(). because a) it will involve the banned TimeTicks::ToInternalValue(), b) TimeTicks difference in JS becomes meaningless because it has no unit. Bug: 1269417 Change-Id: I18a1868ce1c1f9498660c7298b038907d0fef25a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3331615 Reviewed-by:Kentaro Hara <haraken@chromium.org> Reviewed-by:
Nasko Oskov <nasko@chromium.org> Reviewed-by:
Demetrios Papadopoulos <dpapad@chromium.org> Commit-Queue: Keren Zhu <kerenzhu@chromium.org> Cr-Commit-Position: refs/heads/main@{#958422}
Loading
Please register or sign in to comment