2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
11 #ifdef HAVE_SYS_TIME_H
12 # include <sys/time.h>
20 #include "ecore_private.h"
24 /* FIXME: clock_gettime() is an option... */
27 * Retrieves the current system time as a floating point value in seconds.
29 * Also see ecore_loop_time_get().
31 * @return The number of seconds since 12.00AM 1st January 1970.
32 * @ingroup Ecore_Time_Group
38 return evil_time_get();
40 # ifdef HAVE_GETTIMEOFDAY
43 gettimeofday(&timev, NULL);
44 return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
46 # error "Your platform isn't supported yet"
51 double _ecore_loop_time = -1.0;
54 * Retrieves the time at which the last loop stopped waiting for timeouts or events
56 * This gets the time (since Jan 1st, 1970, 12:00AM) that the main loop ceased
57 * waiting for timouts and/or events to come in or for signals or any other
58 * interrupt source. This should be considered a reference point for all
59 * time based activity that should calculate its timepoint from the return
60 * of ecore_loop_time_get(). use this UNLESS you absolutely must get the
61 * current actual timepoint - then use ecore_time_get(). If this is called
62 * before any loop has ever been run, then it will call ecore_time_get() for
63 * you the first time and thus have an initial time reference.
65 * @return The number of seconds since 12.00AM 1st January 1970.
66 * @ingroup Ecore_Time_Group
69 ecore_loop_time_get(void)
71 return _ecore_loop_time;