diff --git a/pcm.cpp b/pcm.cpp
index 85672e7..1266171 100644
--- a/pcm.cpp
+++ b/pcm.cpp
@@ -464,7 +464,7 @@ void print_csv_header(PCM * m,
     )
 {
     // print first header line
-    cout << "System;;";
+    cout << "System;;;";
     if (show_system_output)
     {
     	if (cpu_model == PCM::ATOM || cpu_model == PCM::KNL)
@@ -613,7 +613,8 @@ void print_csv_header(PCM * m,
     }
 
     // print second header line
-    cout << "\nDate;Time;";
+    cout << "\nDate;Time;TimeStamp;";
+
     if (show_system_output)
     {
         if (cpu_model == PCM::ATOM || cpu_model == PCM::KNL)
@@ -776,6 +777,7 @@ void print_csv(PCM * m,
     const bool show_system_output
     )
 {
+	double ts = pcm_timestamp();
 #ifndef _MSC_VER
     struct timeval timestamp;
     gettimeofday(&timestamp, NULL);
@@ -791,6 +793,10 @@ void print_csv(PCM * m,
 #else
         << "." << setw(3) << ceil(timestamp.tv_usec / 1000) << ';';
 #endif
+    //cout.precision(6);
+	cout.precision(6);
+	cout << std::setw(16) << std::fixed << ts << ";" << setw(3);
+    cout.precision(3);
     cout.fill(old_fill);
 
     if (show_system_output)
diff --git a/utils.cpp b/utils.cpp
index 2b0248c..a811cd3 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -405,3 +405,95 @@ void MySystem(char * sysCmd, char ** sysArgv)
     }
 #endif
 }
+
+#ifdef _WIN32
+static double QP_freq_inv = 0.0;
+static int64_t QP_initial = 0;
+
+static void QP_init(void)
+{
+    LARGE_INTEGER li;
+    if(!QueryPerformanceFrequency(&li)) {
+        printf("QueryPerformanceFrequency issues. Bye at %s %d\n", __FILE__, __LINE__);
+        exit(1);
+    }
+
+    double freq = (double)li.QuadPart;
+    QP_freq_inv = 1.0/freq;
+
+    QueryPerformanceCounter(&li);
+    QP_initial = li.QuadPart;
+}
+static double QP_diff(void)
+{
+    static bool first_time=true;
+    if (first_time) {
+        QP_init();
+        first_time = false;
+    }
+    LARGE_INTEGER li;
+    QueryPerformanceCounter(&li);
+    return QP_freq_inv * (double)(li.QuadPart-QP_initial);
+}
+
+int gettimeofday(struct timeval * tp, struct timezone * tzp)
+{
+    // from https://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows
+    // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's
+    // This magic number is the number of 100 nanosecond intervals since January 1, 1601 (UTC)
+    // until 00:00:00 January 1, 1970 
+    static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL);
+
+    FILETIME    file_time;
+    uint64_t    time;
+
+#if 1
+    GetSystemTimePreciseAsFileTime(&file_time); // for win 8+... gets link err on win7
+#else
+    GetSystemTimeAsFileTime(&file_time); // for win7
+#endif
+    time =  ((uint64_t)file_time.dwLowDateTime )      ;
+    time += ((uint64_t)file_time.dwHighDateTime) << 32;
+
+    time -= EPOCH;
+    tp->tv_sec  = (long) (time / 10000000L);
+    tp->tv_usec = (long) (time % 10000000L);
+    return 0;
+}
+
+double getfiletime(void)
+{
+    FILETIME    file_time;
+    uint64_t    time;
+	double x;
+
+#if 1
+    GetSystemTimePreciseAsFileTime(&file_time); // for win 8+... gets link err on win7
+#else
+    GetSystemTimeAsFileTime(&file_time); // for win7
+#endif
+    time =  ((uint64_t)file_time.dwLowDateTime )      ;
+    time += ((uint64_t)file_time.dwHighDateTime) << 32;
+	x = (double)time;
+	return 1.0e-7 * x;
+}
+#endif
+
+double pcm_timestamp(void)
+{
+#ifdef _WIN32
+    static double gtod_initial=0.0;
+    if (gtod_initial == 0.0) {
+        //struct timeval tv;
+        //gettimeofday(&tv, NULL);
+        //gtod_initial = (double)tv.tv_sec + 1.0e-6 * (double)(tv.tv_usec);
+		gtod_initial = getfiletime();
+        //printf("gettimeofday initial= %f at %s %d\n", gtod_initial, __FILE__, __LINE__);
+    }
+    return gtod_initial + QP_diff();
+#else
+	struct timespec tp;
+	clock_gettime(CLOCK_MONOTONIC, &tp);
+	return (double)(tp.tv_sec) + 1.0e-9 * (double)(tp.tv_nsec);
+#endif
+}
diff --git a/utils.h b/utils.h
index ee15d9d..3e40e1f 100644
--- a/utils.h
+++ b/utils.h
@@ -97,6 +97,8 @@ inline void MySleepUs(int delay_us)
 }
 
 void MySystem(char * sysCmd, char ** argc);
+double pcm_timestamp(void);
+
 
 #ifdef _MSC_VER
 #pragma warning (disable : 4068 ) // disable unknown pragma warning
