From: mquinson Date: Fri, 10 Dec 2004 06:49:37 +0000 (+0000) Subject: Fix (c) dates; Initiate win32 cross-port X-Git-Tag: v3.3~4758 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dbb096197272b1a4c5b1eb8ffe2869655fd4782b?hp=ece8568526599562201b6ac73b53fc0e44fb15b1 Fix (c) dates; Initiate win32 cross-port git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@592 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Virtu/rl_time.c b/src/gras/Virtu/rl_time.c index 2b2206f93f..9eee7d59d8 100644 --- a/src/gras/Virtu/rl_time.c +++ b/src/gras/Virtu/rl_time.c @@ -2,21 +2,29 @@ /* time - time related syscal wrappers */ -/* Copyright (c) 2004 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "portable.h" + #include "xbt/sysdep.h" #include "gras/virtu.h" -#include /* gettimeofday() */ + double gras_os_time() { +#ifdef HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return (double)(tv.tv_sec * 1000000 + tv.tv_usec); +#else + /* Poor resolution */ + return (double)(time(NULL)); +#endif /* HAVE_GETTIMEOFDAY? */ + } void gras_os_sleep(unsigned long sec,unsigned long usec) {