ICEACE Model: Closed Economy  1.0.0
Design Documentation of ICEACE Model
 All Data Structures Files Functions Variables Typedefs Macros Pages
timing.c
Go to the documentation of this file.
1 
6 #include "header.h"
7 
8 #include <sys/time.h>
9 
16 double get_time(void) {
17  struct timeval now;
18 
19  /* in some implementations, clock() wraps round after 36 minutes.
20  * use gettimeofday() instead, which gives us time since the Epoch
21  */
22 # ifndef S_SPLINT_S
23  gettimeofday(&now, NULL);
24 # endif
25 
26  /* return time in secs */
27  return now.tv_sec + (now.tv_usec * 1.e-6);
28 }
29