YAZ  5.23.1
gettimeofday.c
Go to the documentation of this file.
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data
3  * See the file LICENSE for details.
4  */
5 
11 #if HAVE_CONFIG_H
12 #include <config.h>
13 #endif
14 
15 #include <assert.h>
16 #include <stdlib.h>
17 #include <string.h>
18 
19 #ifdef WIN32
20 #include <windows.h>
21 #include <sys/timeb.h>
22 #endif
23 #if HAVE_SYS_TIME_H
24 #include <sys/time.h>
25 #endif
26 #include <yaz/gettimeofday.h>
27 
28 int yaz_gettimeofday(struct timeval *tval)
29 {
30 #ifdef WIN32
31  struct _timeb timeb;
32  _ftime(&timeb);
33  tval->tv_sec = timeb.time;
34  tval->tv_usec = timeb.millitm * 1000;
35  return 0;
36 #else
37  return gettimeofday(tval, 0);
38 #endif
39 }
40 
41 /*
42  * Local variables:
43  * c-basic-offset: 4
44  * c-file-style: "Stroustrup"
45  * indent-tabs-mode: nil
46  * End:
47  * vim: shiftwidth=4 tabstop=8 expandtab
48  */
49 
int yaz_gettimeofday(struct timeval *tval)
gettimeofday
Definition: gettimeofday.c:28
Header for gettimeofday wrapper.