diff --git a/lib/cliquer.c b/lib/cliquer.c
index 49d0ad5..8cdbf71 100644
--- a/lib/cliquer.c
+++ b/lib/cliquer.c
@@ -11,7 +11,9 @@
 #include <limits.h>
 #include <unistd.h>
 #include <sys/time.h>
+#if !defined(__MINGW64__)
 #include <sys/times.h>
+#endif
 
 #include "cliquer/cliquer.h"
 
@@ -33,7 +35,9 @@ clique_options *clique_default_options=&clique_default_options_struct;
 static int *clique_size;      /* c[i] == max. clique size in {0,1,...,i-1} */
 static set_t current_clique;  /* Current clique being searched. */
 static set_t best_clique;     /* Largest/heaviest clique found so far. */
+#if !defined(__MINGW64__)
 static struct tms cputimer;      /* Timer for opts->time_function() */
+#endif
 static struct timeval realtimer; /* Timer for opts->time_function() */
 static int clique_list_count=0;  /* No. of cliques in opts->clique_list[] */
 static int weight_multiplier=1;  /* Weights multiplied by this when passing
@@ -60,9 +64,7 @@ int old_clique_list_count = clique_list_count;          \
 int old_weight_multiplier = weight_multiplier;          \
 int **old_temp_list = temp_list;                        \
 int old_temp_count = temp_count;                        \
-struct tms old_cputimer;                                \
 struct timeval old_realtimer;                           \
-memcpy(&old_cputimer,&cputimer,sizeof(struct tms));       \
 memcpy(&old_realtimer,&realtimer,sizeof(struct timeval));
 
 #define ENTRANCE_RESTORE() \
@@ -73,12 +75,13 @@ clique_list_count = old_clique_list_count;              \
 weight_multiplier = old_weight_multiplier;              \
 temp_list = old_temp_list;                              \
 temp_count = old_temp_count;                            \
-memcpy(&cputimer,&old_cputimer,sizeof(struct tms));       \
 memcpy(&realtimer,&old_realtimer,sizeof(struct timeval));
 
 
 /* Number of clock ticks per second (as returned by sysconf(_SC_CLK_TCK)) */
+#if !defined(__MINGW64__)
 static int clocks_per_sec=0;
+#endif
 
 
 
@@ -138,7 +141,9 @@ static boolean false_function(set_t clique,graph_t *g,clique_options *opts);
  */
 static int unweighted_clique_search_single(int *table, int min_size,
 					   graph_t *g, clique_options *opts) {
+#if !defined(__MINGW64__)
 	struct tms tms;
+#endif
 	struct timeval timeval;
 	int i,j;
 	int v,w;
@@ -179,13 +184,19 @@ static int unweighted_clique_search_single(int *table, int min_size,
 
 		if (opts && opts->time_function) {
 			gettimeofday(&timeval,NULL);
+#if !defined(__MINGW64__)
 			times(&tms);
+#endif
 			if (!opts->time_function(entrance_level,
 						 i+1,g->n,clique_size[v] *
 						 weight_multiplier,
+                                                 #if !defined(__MINGW64__)
 						 (double)(tms.tms_utime-
 							  cputimer.tms_utime)/
 						 clocks_per_sec,
+                                                 #else
+                                                 0,
+                                                 #endif
 						 timeval.tv_sec-
 						 realtimer.tv_sec+
 						 (double)(timeval.tv_usec-
@@ -335,7 +346,9 @@ static int unweighted_clique_search_all(int *table, int start,
 					boolean maximal, graph_t *g,
 					clique_options *opts) {
 	struct timeval timeval;
+#if !defined(__MINGW64__)
 	struct tms tms;
+#endif
 	int i,j;
 	int v;
 	int *newtable;
@@ -376,13 +389,19 @@ static int unweighted_clique_search_all(int *table, int start,
 
 		if (opts->time_function) {
 			gettimeofday(&timeval,NULL);
+#if !defined(__MINGW64__)
 			times(&tms);
+#endif
 			if (!opts->time_function(entrance_level,
 						 i+1,g->n,min_size *
 						 weight_multiplier,
+#if !defined(__MINGW64__)
 						 (double)(tms.tms_utime-
 							  cputimer.tms_utime)/
 						 clocks_per_sec,
+#else
+                                                 0,
+#endif
 						 timeval.tv_sec-
 						 realtimer.tv_sec+
 						 (double)(timeval.tv_usec-
@@ -539,7 +558,9 @@ static int weighted_clique_search_single(int *table, int min_weight,
 					 int max_weight, graph_t *g,
 					 clique_options *opts) {
 	struct timeval timeval;
+#if !defined(__MINGW64__)
 	struct tms tms;
+#endif
 	int i,j;
 	int v;
 	int *newtable;
@@ -629,13 +650,19 @@ static int weighted_clique_search_single(int *table, int min_weight,
 
 		if (opts->time_function) {
 			gettimeofday(&timeval,NULL);
+#if !defined(__MINGW64__)
 			times(&tms);
+#endif
 			if (!opts->time_function(entrance_level,
 						 i+1,g->n,clique_size[v] *
 						 weight_multiplier,
+#if !defined(__MINGW64__)
 						 (double)(tms.tms_utime-
 							  cputimer.tms_utime)/
 						 clocks_per_sec,
+#else
+                                                 0,
+#endif
 						 timeval.tv_sec-
 						 realtimer.tv_sec+
 						 (double)(timeval.tv_usec-
@@ -687,7 +714,9 @@ static int weighted_clique_search_all(int *table, int start,
 				      boolean maximal, graph_t *g,
 				      clique_options *opts) {
 	struct timeval timeval;
+#if !defined(__MINGW64__)
 	struct tms tms;
+#endif
 	int i,j;
 	int v;
 	int *newtable;
@@ -730,13 +759,19 @@ static int weighted_clique_search_all(int *table, int start,
 
 		if (opts->time_function) {
 			gettimeofday(&timeval,NULL);
+#if !defined(__MINGW64__)
 			times(&tms);
+#endif
 			if (!opts->time_function(entrance_level,
 						 i+1,g->n,clique_size[v] *
 						 weight_multiplier,
+#if !defined(__MINGW64__)
 						 (double)(tms.tms_utime-
 							  cputimer.tms_utime)/
 						 clocks_per_sec,
+#else
+                                                 0,
+#endif
 						 timeval.tv_sec-
 						 realtimer.tv_sec+
 						 (double)(timeval.tv_usec-
@@ -1106,9 +1141,11 @@ set_t clique_unweighted_find_single(graph_t *g,int min_size,int max_size,
 		return NULL;
 	}
 
+#if !defined(__MINGW64__)
 	if (clocks_per_sec==0)
 		clocks_per_sec=sysconf(_SC_CLK_TCK);
 	ASSERT(clocks_per_sec>0);
+#endif
 
 	/* Dynamic allocation */
 	current_clique=set_new(g->n);
@@ -1119,7 +1156,9 @@ set_t clique_unweighted_find_single(graph_t *g,int min_size,int max_size,
 
 	/* "start clock" */
 	gettimeofday(&realtimer,NULL);
+#if !defined(__MINGW64__)
 	times(&cputimer);
+#endif
 
 	/* reorder */
 	if (opts->reorder_function) {
@@ -1230,9 +1269,11 @@ int clique_unweighted_find_all(graph_t *g, int min_size, int max_size,
 		return 0;
 	}
 
+#if !defined(__MINGW64__)
 	if (clocks_per_sec==0)
 		clocks_per_sec=sysconf(_SC_CLK_TCK);
 	ASSERT(clocks_per_sec>0);
+#endif
 
 	/* Dynamic allocation */
 	current_clique=set_new(g->n);
@@ -1246,7 +1287,9 @@ int clique_unweighted_find_all(graph_t *g, int min_size, int max_size,
 
 	/* "start clock" */
 	gettimeofday(&realtimer,NULL);
+#if !defined(__MINGW64__)
 	times(&cputimer);
+#endif
 
 	/* reorder */
 	if (opts->reorder_function) {
@@ -1380,9 +1423,11 @@ set_t clique_find_single(graph_t *g,int min_weight,int max_weight,
 		return NULL;
 	}
 
+#if !defined(__MINGW64__)
 	if (clocks_per_sec==0)
 		clocks_per_sec=sysconf(_SC_CLK_TCK);
 	ASSERT(clocks_per_sec>0);
+#endif
 
 	/* Check whether we can use unweighted routines. */
 	if (!graph_weighted(g)) {
@@ -1417,7 +1462,9 @@ set_t clique_find_single(graph_t *g,int min_weight,int max_weight,
 
 	/* "start clock" */
 	gettimeofday(&realtimer,NULL);
+#if !defined(__MINGW64__)
 	times(&cputimer);
+#endif
 
 	/* reorder */
 	if (opts->reorder_function) {
@@ -1539,9 +1586,11 @@ int clique_find_all(graph_t *g, int min_weight, int max_weight,
 		return 0;
 	}
 
+#if !defined(__MINGW64__)
 	if (clocks_per_sec==0)
 		clocks_per_sec=sysconf(_SC_CLK_TCK);
 	ASSERT(clocks_per_sec>0);
+#endif
 
 	if (!graph_weighted(g)) {
 		min_weight=DIV_UP(min_weight,g->weights[0]);
@@ -1573,7 +1622,9 @@ int clique_find_all(graph_t *g, int min_weight, int max_weight,
 
 	/* "start clock" */
 	gettimeofday(&realtimer,NULL);
+#if !defined(__MINGW64__)
 	times(&cputimer);
+#endif
 
 	/* reorder */
 	if (opts->reorder_function) {
diff --git a/lib/reorder.c b/lib/reorder.c
index 9ec127d..add2b12 100644
--- a/lib/reorder.c
+++ b/lib/reorder.c
@@ -9,7 +9,9 @@
 #include "cliquer/reorder.h"
 
 #include <time.h>
+#if !defined(__MINGW64__)
 #include <sys/times.h>
+#endif
 #include <stdlib.h>
 
 #include <limits.h>
@@ -406,12 +408,18 @@ int *reorder_by_degree(graph_t *g, boolean weighted) {
  *       is called using the system time.
  */
 int *reorder_by_random(graph_t *g, boolean weighted) {
+#if !defined(__MINGW64__)
 	struct tms t;
+#endif
 	int i,r;
 	int *new;
 	boolean *used;
 
+#if !defined(__MINGW64__)
 	srand(times(&t)+time(NULL));
+#else
+	srand(time(NULL));
+#endif
 
 	new=calloc(g->n, sizeof(int));
 	used=calloc(g->n, sizeof(boolean));
