File: milliseconds.c

package info (click to toggle)
dq 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,020 kB
  • sloc: ansic: 8,269; makefile: 363; sh: 176; python: 82
file content (18 lines) | stat: -rw-r--r-- 262 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
20130505
Jan Mojzis
Public domain.
*/

#include <time.h>
#include <sys/time.h>
#include "milliseconds.h"

long long milliseconds(void) {

    struct timeval t;
    gettimeofday(&t, (struct timezone *)0);
    return t.tv_sec * 1000LL + t.tv_usec / 1000LL;

}