2 /**-------------------------------------------------------------------**
4 **-------------------------------------------------------------------**
6 **-------------------------------------------------------------------**
7 ** First version: January 8th 2014 **
8 **-------------------------------------------------------------------**/
11 /******************************************************************************
12 * CLooG : the Chunky Loop Generator (experimental) *
13 ******************************************************************************
15 * Copyright (C) 2002-2005 Cedric Bastoul *
17 * This library is free software; you can redistribute it and/or *
18 * modify it under the terms of the GNU Lesser General Public *
19 * License as published by the Free Software Foundation; either *
20 * version 2.1 of the License, or (at your option) any later version. *
22 * This library is distributed in the hope that it will be useful, *
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
25 * Lesser General Public License for more details. *
27 * You should have received a copy of the GNU Lesser General Public *
28 * License along with this library; if not, write to the Free Software *
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
30 * Boston, MA 02110-1301 USA *
32 * CLooG, the Chunky Loop Generator *
33 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
35 ******************************************************************************/
40 #include "../include/cloog/cloog.h"
43 * cloog_util_rtclock function:
44 * this function returns the value, in seconds, of the real time clock of
45 * the operating system. The reference point between calls is consistent,
46 * making time comparison possible.
47 * \return The real time clock of the operating system in seconds.
49 double cloog_util_rtclock() {
52 int stat
= gettimeofday(&Tp
, &Tzp
);
54 cloog_msg(NULL
, CLOOG_WARNING
, "Error return from gettimeofday: %d", stat
);
55 return (Tp
.tv_sec
+ Tp
.tv_usec
*1.0e-6);