Browse Source

Add DUK_USE_GET_MONOTONIC_TIME config option

pull/1659/head
Sami Vaarala 7 years ago
parent
commit
d51fffbb3e
  1. 4
      config/config-options/DUK_USE_DATE_GET_NOW.yaml
  2. 21
      config/config-options/DUK_USE_GET_MONOTONIC_TIME.yaml

4
config/config-options/DUK_USE_DATE_GET_NOW.yaml

@ -6,3 +6,7 @@ tags:
- portability
description: >
Mandatory macro for getting the current time, see datetime.rst.
If the time provided experiences time jumps or doesn't advance in realtime
(which is useful in some time virtualization scenarios), consider defining
DUK_USE_GET_MONOTONIC_TIME.

21
config/config-options/DUK_USE_GET_MONOTONIC_TIME.yaml

@ -0,0 +1,21 @@
define: DUK_USE_GET_MONOTONIC_TIME
introduced: 2.2.0
default: false
tags:
- date
- portability
description: >
Optional macro for getting monotonic time starting from an arbitrary
starting point (device startup, program startup, script startup, etc).
The time returned must increase monotonically, and must not jump
discontinuously even if system date/time is reset. The semantics are
similar to POSIX clock_gettime() CLOCK_MONOTONIC.
Monotonic time is used by Duktape for its internal needs, such as rate
limiting debugger transport peek callbacks. If this option is not provided,
Duktape falls back to using DUK_USE_DATE_GET_NOW() which is usually fine.
If DUK_USE_DATE_GET_NOW() experiences time jumps or doesn't run in realtime
(which may be useful for some time virtualization cases) it's recommended
to provide this config option so that internals which need a reliable
realtime rate have a reliable time basis.
Loading…
Cancel
Save