Skip to content

Commit

Permalink
Define the EpochTimeStamp typedef (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Oct 9, 2021
1 parent 015f23f commit 160cde6
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions index.html
Expand Up @@ -352,6 +352,20 @@ <h3>
The <dfn data-export="">unsafe shared current time</dfn> must return
the current value of the <a>shared monotonic clock</a>.
</p>
<p>
To get an <dfn data-export="">epoch-relative timestamp</dfn>,
optionally with a date-time |time|:
</p>
<ol class="algorithm">
<li>If |time| was not passed, set |time| to the current time.
</li>
<li>
Assert: |time| is greater than or equal to 1 January 1970 00:00:00 UTC.
</li>
<li>Return the number of milliseconds from 1 January 1970 00:00:00 UTC
to |time|.
</li>
</ol>
</section>
<section id="sec-domhighrestimestamp">
<h3>
Expand All @@ -372,6 +386,30 @@ <h3>
see <a href="#clock-resolution"></a> for additional considerations.
</p>
</section>
<section>
<h3>
The <dfn>EpochTimeStamp</dfn> typedef
</h3>
<pre class="idl">
typedef unsigned long long EpochTimeStamp;
</pre>
<aside class="note" title="Legacy platform feature">
<p>
The use of `EpochTimeStamp`, known previously as `DOMTimeStamp`, is
discouraged. Wherever possible use {{DOMHighResTimeStamp}} instead.
</p>
</aside>
<p>
A {{EpochTimeStamp}} represents the number of milliseconds from a given
time to 01 January, 1970 00:00:00 UTC. Specifications that use this
type define how the number of milliseconds are interpreted. An
{{EpochTimeStamp}} is initialized by calling [=epoch-relative
timestamp=] with no arguments, which defaults to the current time.
Specifications that require a different relative time can call
[=epoch-relative timestamp=] with a date-time as an argument, if
needed.
</p>
</section>
<section id="sec-performance" data-dfn-for="Performance">
<h3>
The <dfn>Performance</dfn> interface
Expand Down

0 comments on commit 160cde6

Please sign in to comment.