summaryrefslogtreecommitdiff
path: root/lib/gettimeofday.c
blob: 274b7fca2f4f7ef5e5d2c630f49ad2bb12ab6740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* replacement function of gettimeofday */

#include "config.h"

#include <sys/timeb.h>
#ifdef WIN32
#include <winsock.h>
#else
#include <sys/time.h>
#endif

int xine_private_gettimeofday(struct timeval *tv) {
  struct timeb tp;

  ftime(&tp);
  tv->tv_sec = tp.time;
  tv->tv_usec = tp.millitm * 1000;

  return 0;
}