2 * Copyright (c) 2020 Yubico AB. All rights reserved.
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file.
7 #include "openbsd-compat.h"
9 #if !defined(HAVE_CLOCK_GETTIME)
13 clock_gettime(clockid_t clock_id, struct timespec *tp)
17 if (clock_id != CLOCK_MONOTONIC) {
22 ms = GetTickCount64();
23 tp->tv_sec = ms / 1000L;
24 tp->tv_nsec = (ms % 1000L) * 1000000L;
29 #error "please provide an implementation of clock_gettime() for your platform"
32 #endif /* !defined(HAVE_CLOCK_GETTIME) */