3 /* sysdep.c -- all system dependency */
4 /* no system header should be loaded out of this file so that we have only */
5 /* one file to check when porting to another OS */
7 /* Copyright (c) 2004 Martin Quinson. All rights reserved. */
9 /* This program is free software; you can redistribute it and/or modify it
10 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "xbt/sysdep.h"
13 #include "xbt/xbt_portability.h" /* private */
15 #include "xbt/error.h"
18 /* \defgroup XBT_sysdep All system dependency
19 * \brief This section describes many macros/functions that can serve as
23 double xbt_os_time(void) {
24 #ifdef HAVE_GETTIMEOFDAY
27 gettimeofday(&tv, NULL);
29 return (double)(tv.tv_sec + tv.tv_usec / 1000000.0);
32 return (double)(time(NULL));
33 #endif /* HAVE_GETTIMEOFDAY? */
37 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sysdep, xbt, "System dependency");