monotonicNow.js 682 B

1234567891011121314
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. const now = WScript.monotonicNow;
  7. // Using <= instead of < because output number precision might be lost
  8. if (now() <= now() && now() <= now()) {
  9. print("pass");
  10. } else {
  11. print("fail");
  12. }