1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2006 by Dominic Rath *
5 * Dominic.Rath@gmx.de *
7 * Copyright (C) 2007,2008 Øyvind Harboe *
8 * oyvind.harboe@zylin.com *
10 * Copyright (C) 2008 by Spencer Oliver *
11 * spen@spen-soft.co.uk *
12 ***************************************************************************/
18 #include "time_support.h"
20 /* simple and low overhead fetching of ms counter. Use only
21 * the difference between ms counters returned from this fn.
23 int64_t timeval_ms(void)
26 int retval = gettimeofday(&now, NULL);
29 return (int64_t)now.tv_sec * 1000 + now.tv_usec / 1000;