Skip to content

Commit 1b8a56c

Browse files
authored
timestamp: Redefine timestamp in Data delivery (#274)
Use more precise terms from the HR-TIME spec to define what `PressureRecord.time` is relative to: - Any timestamp value obtained from the platform is converted to an unsafe moment from the monotonic clock. - PressureRecord.[[Time]] converts it into a coarsened time relative to its global's origin. Fixes #257
1 parent bb6a3d7 commit 1b8a56c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

index.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,17 +1129,27 @@

Data delivery

11291129
li>
11301130
<li>
11311131
Let |state:PressureState| be an [=adjusted pressure state=] given |data| and |source|.
1132-
li>
1133-
<li>
1134-
Let |timestamp:DOMHighResTimeStamp| be a timestamp representing the time the |data| was
1135-
obtained from the |relevantGlobal|'s [=platform collector=].
11361132
<aside class="note">
11371133
The |data| sample and mapping between |data| sample, and [=pressure states=],
11381134
is [=implementation-defined=] and may use many different metrics. For instance,
11391135
for CPU, it might consider processor frequency and utilization, as well
11401136
as thermal conditions.
11411137
aside>
11421138
li>
1139+
<li>
1140+
Let |timestamp| be a platform-specific timestamp converted in an [=implementation-defined=]
1141+
way to an [=monotonic clock/unsafe current time=] using the same [=monotonic clock=]
1142+
that is shared by [=environment settings object/time origins=].
1143+
<aside class="note">
1144+
The goal of this step is to ensure that a timestamp that may have been relative to
1145+
a different time origin is converted to a value that can be used in computations with
1146+
the same [=monotonic clock=] used by the operations described in [[HR-TIME]].
1147+
aside>
1148+
li>
1149+
<li>
1150+
Let |timeValue| be the [=relative high resolution time=] based on |timestamp| and
1151+
|relevantGlobal|.
1152+
li>
11431153
<li>
11441154
[=list/For each=] |observer:PressureObserver| in |relevantGlobal|'s
11451155
[=registered observer list=] for |source|:
@@ -1160,7 +1170,7 @@

Data delivery

11601170
Let |record:PressureRecord| be a new {{PressureRecord}} object with its
11611171
{{PressureRecord/[[Source]]}} set to |source|,
11621172
{{PressureRecord/[[State]]}} set to |state|
1163-
and {{PressureRecord/[[Time]]}} set to |timestamp|.
1173+
and {{PressureRecord/[[Time]]}} set to |timeValue|.
11641174
li>
11651175
<li>
11661176
If |observer|.{{PressureObserver/[[AfterPenaltyRecordMap]]}}[source] [=map/exists=]:

0 commit comments

Comments
 (0)