Index: lemon/bits/mingw32_time.h
===================================================================
--- lemon/bits/mingw32_time.h	(revision 2028)
+++ lemon/bits/mingw32_time.h	(revision 2028)
@@ -0,0 +1,137 @@
+/* -*- C++ -*-
+ *
+ * This file is a part of LEMON, a generic C++ optimization library
+ *
+ * Copyright (C) 2003-2006
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
+ *
+ * Permission to use, modify and distribute this software is granted
+ * provided that this copyright notice appears in all copies. For
+ * precise terms see the accompanying LICENSE file.
+ *
+ * This software is provided "AS IS" with no warranty of any kind,
+ * express or implied, and with no claim as to its suitability for any
+ * purpose.
+ *
+ */
+
+#ifndef LEMON_BITS_MINGW32_TIME_H
+#define LEMON_BITS_MINGW32_TIME_H
+
+#ifdef WIN32
+
+#include <windows.h>
+#include <time.h>
+#include "dos.h"
+
+static const char days[] = 
+"Sun Mon Tue Wed Thu Fri Sat ";
+static const char months[] = 
+"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ";
+
+inline void num2str(char *c,int i) {
+  c[0]=i/10+'0';
+  c[1]=i%10+'0';
+}
+
+inline char *asctime_r(const struct tm *t, char *buf) {
+  /* "Wed Jun 30 21:49:08 1993\n" */
+  *(int*)buf=*(int*)(days+(t->tm_wday<<2));
+  *(int*)(buf+4)=*(int*)(months+(t->tm_mon<<2));
+  num2str(buf+8,t->tm_mday);
+  if (buf[8]=='0') buf[8]=' ';
+  buf[10]=' ';
+  num2str(buf+11,t->tm_hour);
+  buf[13]=':';
+  num2str(buf+14,t->tm_min);
+  buf[16]=':';
+  num2str(buf+17,t->tm_sec);
+  buf[19]=' ';
+  num2str(buf+20,(t->tm_year+1900)/100);
+  num2str(buf+22,(t->tm_year+1900)%100);
+  buf[24]='\n'; buf[25]='\0';
+  return buf;
+}
+
+inline struct tm * localtime_r (const time_t *t, struct tm *tm) {
+  struct tm *tmp;
+  
+  if ((tmp = localtime(t)) && tm)
+    *tm = *tmp;
+  else
+    return 0;
+  
+  return tm;
+}
+
+inline char *ctime_r(const time_t * tim_p , char * result) {
+  struct tm tm;
+  return asctime_r (localtime_r (tim_p, &tm), result);
+}
+
+
+inline int gettimeofday(struct timeval * tp, struct timezone *) {
+  SYSTEMTIME systime;
+
+  if (tp) {
+    struct tm tmrec;
+    time_t theTime = time(NULL);
+    
+    
+    tmrec = *localtime(&theTime);
+    tp->tv_sec = mktime(&tmrec);
+    GetLocalTime(&systime); /* system time */
+
+    tp->tv_usec = systime.wMilliseconds * 1000;
+  }
+  return 0;
+}
+
+
+struct tms {
+  long	tms_utime;
+  long	tms_stime;
+  long	tms_cutime;
+  long	tms_cstime;
+};
+
+inline long filetime_to_clock(FILETIME *ft)
+{
+  __int64 qw = ft->dwHighDateTime;
+  qw <<= 32;
+  qw |= ft->dwLowDateTime;
+  qw /= 10000;  /* File time ticks at 0.1uS, clock at 1mS */
+  return (long) qw;
+
+}
+
+inline int times(struct tms *tmbuf)
+{
+  FILETIME create, exit, kernel, user;
+  if (GetProcessTimes(GetCurrentProcess(),&create, &exit, &kernel, &user)) {
+    tmbuf->tms_utime = filetime_to_clock(&user);
+    tmbuf->tms_stime = filetime_to_clock(&kernel);
+    tmbuf->tms_cutime = 0;
+    tmbuf->tms_cstime = 0;
+  }
+  else {
+    tmbuf->tms_utime = clock();
+    tmbuf->tms_stime = 0;
+    tmbuf->tms_cutime = 0;
+    tmbuf->tms_cstime = 0;
+  }
+  return 0;
+}
+
+#define _SC_CLK_TCK 1
+
+inline int sysconf(int)
+{
+  return 1;
+}
+
+#endif
+
+
+#endif
Index: lemon/graph_to_eps.h
===================================================================
--- lemon/graph_to_eps.h	(revision 1993)
+++ lemon/graph_to_eps.h	(revision 2028)
@@ -21,4 +21,8 @@
 
 #include <sys/time.h>
+
+#ifdef WIN32
+#include <lemon/bits/mingw32_time.h>
+#endif
 
 #include<iostream>
Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 2027)
+++ lemon/time_measure.h	(revision 2028)
@@ -26,71 +26,5 @@
 
 #ifdef WIN32
-
-#include <windows.h>
-#include <time.h>
-#include "dos.h"
-
-int gettimeofday(struct timeval * tp, struct timezone *) {
-  SYSTEMTIME      systime;
-
-  if (tp) {
-
-    struct tm tmrec;
-    time_t theTime = time(NULL);
-
-    tmrec = *localtime(&theTime);
-    tp->tv_sec = mktime(&tmrec);
-    GetLocalTime(&systime); /* system time */
-
-    tp->tv_usec = systime.wMilliseconds * 1000;
-
-  }
-
-  return 0;
-
-}
-
-struct tms {
-  long	tms_utime;
-  long	tms_stime;
-  long	tms_cutime;
-  long	tms_cstime;
-};
-
-static long filetime_to_clock(FILETIME *ft)
-{
-  __int64 qw = ft->dwHighDateTime;
-  qw <<= 32;
-  qw |= ft->dwLowDateTime;
-  qw /= 10000;  /* File time ticks at 0.1uS, clock at 1mS */
-  return (long) qw;
-
-}
-
-int times(struct tms *tmbuf)
-{
-  FILETIME create, exit, kernel, user;
-  if (GetProcessTimes(GetCurrentProcess(),&create, &exit, &kernel, &user)) {
-    tmbuf->tms_utime = filetime_to_clock(&user);
-    tmbuf->tms_stime = filetime_to_clock(&kernel);
-    tmbuf->tms_cutime = 0;
-    tmbuf->tms_cstime = 0;
-  }
-  else {
-    tmbuf->tms_utime = clock();
-    tmbuf->tms_stime = 0;
-    tmbuf->tms_cutime = 0;
-    tmbuf->tms_cstime = 0;
-  }
-  return 0;
-}
-
-#define _SC_CLK_TCK 1
-
-int sysconf(int)
-{
-  return 1;
-}
-
+#include <lemon/bits/mingw32_time.h>
 #else
 #include <sys/times.h>
@@ -142,6 +76,8 @@
     const rtms &getTms() const {return ts;}
 
-    void _reset() 
-    { ts.tms_utime=ts.tms_stime=ts.tms_cutime=ts.tms_cstime=0; real_time=0;}
+    void _reset() { 
+      ts.tms_utime = ts.tms_stime = ts.tms_cutime = ts.tms_cstime = 0; 
+      real_time = 0;
+    }
 
   public:
