16 #include "ecore_private.h"
20 /* FIXME: clock_gettime() is an option... */
23 * Retrieves the current system time as a floating point value in seconds.
25 * Also see ecore_loop_time_get().
27 * @return The number of seconds since 12.00AM 1st January 1970.
28 * @ingroup Ecore_Time_Group
34 return evil_time_get();
36 # ifdef HAVE_GETTIMEOFDAY
39 gettimeofday(&timev, NULL);
40 return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
42 # error "Your platform isn't supported yet"
47 double _ecore_loop_time = -1.0;
50 * Retrieves the time at which the last loop stopped waiting for timeouts or events
52 * This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased
53 * waiting for timouts and/or events to come in or for signals or any other
54 * interrupt source. This should be considered a reference point for all
55 * time based activity that should calculate its timepoint from the return
56 * of ecore_loop_time_get(). use this UNLESS you absolutely must get the
57 * current actual timepoint - then use ecore_time_get(). If this is called
58 * before any loop has ever been run, then it will call ecore_time_get() for
59 * you the first time and thus have an initial time reference.
61 * @return The number of seconds since 12.00AM 1st January 1970.
62 * @ingroup Ecore_Time_Group
65 ecore_loop_time_get(void)
67 return _ecore_loop_time;