| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <meta charset="utf-8" /> | |
| 5 <title>window.performance.now() chronology</title> | |
| 6 <link rel="author" title="W3C" href="http://www.w3.org/" /> | |
| 7 <link rel="help" href="http://www.w3.org/TR/hr-time/#sec-monotonic-clock"/> | |
| 8 <script src="/w3c/resources/testharness.js"></script> | |
| 9 <script src="/w3c/resources/testharnessreport.js"></script> | |
| 10 <link rel="stylesheet" href="/w3c/resources/testharness.css" /> | |
| 11 <script> | |
| 12 test(function() { | |
| 13 assert_true(window.performance.now() > 0, "window.performance.now() returns po
sitive numbers"); | |
| 14 }, "window.performance.now() returns a positive number", {assert: "The time valu
es returned when calling the now method MUST be monotonically increasing and not
subject to system clock adjustments or system clock skew."}); | |
| 15 | |
| 16 test(function() { | |
| 17 var now1 = window.performance.now(); | |
| 18 var now2 = window.performance.now(); | |
| 19 assert_true((now2-now1) >= 0, "window.performance.now() difference is not ne
gative"); | |
| 20 }, | |
| 21 "window.performance.now() difference is not negative", | |
| 22 { | |
| 23 assert: "The difference between any two chronologically recorded time values
returned from the now method MUST never be negative." | |
| 24 } | |
| 25 ); | |
| 26 | |
| 27 </script> | |
| 28 </head> | |
| 29 <body> | |
| 30 <h1>Description</h1> | |
| 31 <p>This test validates that window.performance.now() follows the monotonic clock
requirements.</p> | |
| 32 | |
| 33 <div id="log"></div> | |
| 34 | |
| 35 </body> | |
| 36 </html> | |
| OLD | NEW |