~flier-lu/libmemcached/win32-vs2008

« back to all changes in this revision

Viewing changes to win32/wrappers.c

  • Committer: Flier Lu
  • Date: 2011-01-07 04:14:58 UTC
  • Revision ID: flier.lu@gmail.com-20110107041458-fcetl3kuhylxistp
update solution

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "wrappers.h"
 
2
 
 
3
#include <Windows.h>
 
4
 
 
5
int gettimeofday(struct timeval* tv)
 
6
{
 
7
  union {
 
8
    long long ns100;
 
9
    FILETIME ft;
 
10
  } now;
 
11
 
 
12
  GetSystemTimeAsFileTime (&now.ft);
 
13
  tv->tv_usec = (long) ((now.ns100 / 10LL) % 1000000LL);
 
14
  tv->tv_sec = (long) ((now.ns100 - 116444736000000000LL) / 10000000LL);
 
15
  return (0);
 
16
}