#include <folly/Conv.h>
#include <folly/portability/SysSyscall.h>
#include <folly/portability/Unistd.h>
+#include <folly/portability/Windows.h>
#include <chrono>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/utsname.h>
#include <errno.h>
#include <glog/logging.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdexcept>
+#ifndef _MSC_VER
+#include <sys/utsname.h>
+#endif
+
using std::string;
using namespace std::chrono;
namespace folly {
+#ifdef _MSC_VER
+static pid_t gettid() {
+ return pid_t(GetCurrentThreadId());
+}
+#else
/**
* glibc doesn't provide gettid(), so define it ourselves.
*/
return hz;
}
+#endif
/**
* Determine how long this process has spent waiting to get scheduled on the
* time cannot be determined.
*/
static milliseconds getTimeWaitingMS(pid_t tid) {
+#ifdef _MSC_VER
+ return milliseconds(0);
+#else
static int64_t jiffiesHZ = 0;
if (jiffiesHZ == 0) {
jiffiesHZ = determineJiffiesHZ();
LOG(ERROR) << "error determining process wait time: %s" << e.what();
return milliseconds(0);
}
+#endif
}
void TimePoint::reset() {