testing_clock.c 492 B

123456789101112131415161718192021
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include "testing_clock.h"
  5. UA_DateTime testingClock = 0;
  6. UA_DateTime UA_DateTime_now(void) {
  7. return testingClock;
  8. }
  9. UA_DateTime UA_DateTime_nowMonotonic(void) {
  10. return testingClock;
  11. }
  12. void
  13. UA_sleep(UA_UInt32 duration) {
  14. testingClock += duration * UA_MSEC_TO_DATETIME;
  15. }