Re: [compute-pressure] Is PressureRecord.time a timestamp or a time that is relative to timeOrigin? (#257)

> The question is now, what would make more sense? To use Unix Epoch, or another monotonic clock implementation.
> 
> I don't think that 2) as defined in performance.timeOrigin, makes sense for Compute Pressure, since it would be useful to have the same origin for workers and window, without manipulation of the timestamp.

fwiw, I don't know the answer to this. My feeling is that in the Performance APIs, developers are used to working with document-creation-relative-time and not epoch-relative-time. 

I guess currently it would be mixed time information if you use compute pressure with other time markers. For example:

```
function startVideoCall
  performance.mark("video-call-started");
  observer.observe("cpu"); 

function endVideoCall
  performance.mark("video-call-finished");
  observer.disconnect()

// time video-call-started: 5000.23
// time pressure state nominal: 1712050826399.263
// time pressure state fair: 1733350826399.263
// time pressure state nominal: 1788850826399.263
// time video-call-finished: 30000.23 
```

So if we had the same time origins, the advantage would be that the compute pressures could all be lined up in a timeline with other performance-related events. 

```
// time video-call-started: 5000.23
// time pressure state nominal: 8000.57
// time pressure state fair: 20000.67
// time pressure state nominal: 25000.44
// time video-call-finished: 30000.23 
```

-- 
GitHub Notification of comment by Elchi3
Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/257#issuecomment-2033137453 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 2 April 2024 21:33:37 UTC