Ecore time functions

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Functions
Ecore time functions
Ecore

These are function to retrieve time in a given format. More...

## Functions
double | ecore_time_get (void)
| Retrieves the current system time as a floating point value in seconds.
double | ecore_time_unix_get (void)
| Retrieves the current UNIX time as a floating point value in seconds.
double | ecore_loop_time_get (void)
| Retrieves the time at which the last loop stopped waiting for timeouts or events.
void | ecore_loop_time_set (double t)
| Sets the loop time.

## Detailed Description

These are function to retrieve time in a given format.

Examples:

- ecore_time - Differences between time functions

## Function Documentation

## ◆ ecore_time_get()

double ecore_time_get | ( | void |  | ) |

Retrieves the current system time as a floating point value in seconds.

This uses a monotonic clock and thus never goes back in time while machine is live (even if user changes time or timezone changes, however it may be reset whenever the machine is restarted).

Returns
  The number of seconds. Start time is not defined (it may be when the machine was booted, unix time, etc), all it is defined is that it never goes backwards (unless you got big critical messages when the application started).

See also
  ecore_loop_time_get().
  ecore_time_unix_get().

Examples
  ecore_poller_example.c, ecore_time_functions_example.c, ecore_timer_example.c, emotion_test_main.c, and test_velocity.c.

References ecore_time_unix_get(), and EINA_UNLIKELY.

Referenced by ecore_con_client_uptime_get(), ecore_con_server_uptime_get(), ecore_con_ssl_client_upgrade(), ecore_con_ssl_server_upgrade(), ecore_evas_buffer_allocfunc_new(), ecore_loop_time_set(), ecore_sdl_feed_events(), ecore_thread_global_data_wait(), ecore_thread_wait(), and emotion_shutdown().

## ◆ ecore_time_unix_get()

double ecore_time_unix_get | ( | void |  | ) |

Retrieves the current UNIX time as a floating point value in seconds.

See also
  ecore_time_get().
  ecore_loop_time_get().

Returns
  The number of seconds since 12.00AM 1st January 1970.

Examples
  ecore_time_functions_example.c, genlist_example_02.c, genlist_example_03.c, and genlist_example_04.c.

Referenced by ecore_time_get().

## ◆ ecore_loop_time_get()

double ecore_loop_time_get | ( | void |  | ) |

Retrieves the time at which the last loop stopped waiting for timeouts or events.

This gets the time that the main loop ceased waiting for timouts and/or events to come in or for signals or any other interrupt source. This should be considered a reference point for all time based activity that should calculate its timepoint from the return of ecore_loop_time_get(). Use this UNLESS you absolutely must get the current actual timepoint - then use ecore_time_get(). Note that this time is meant to be used as relative to other times obtained on this run. If you need absolute time references, use ecore_time_unix_get() instead.

This function can be called before any loop has ever been run, but either ecore_init() or ecore_time_get() must have been called once.

Returns
  The number of seconds. Start time is not defined (it may be when the machine was booted, unix time, etc), all it is defined is that it never goes backwards (unless you got big critical messages when the application started).

Examples
  ecore_time_functions_example.c, and efl_thread_6.c.

Referenced by ecore_animator_timeline_add(), ecore_evas_manual_render(), efreet_mime_type_cache_flush(), elm_box_layout_transition(), elm_transit_go(), elm_transit_paused_set(), and elput_input_pointer_xy_set().

## ◆ ecore_loop_time_set()

void ecore_loop_time_set | ( | double | t | ) |

Sets the loop time.

Parameters

  t | The new loop time

You should never need/call this, unless you are implementing a custom tick source for an ecore animator. Only then inside your function that calls ecore_animator_custom_tick(), just before it, if you are able to get accurate timing information as to when the source of your tick woke up, use this to adjust the ecore loop time to be perfectly accurate. It is not a requirement, but makes things smoother. You should not use it otherwise as it could harm timeline handling throughout the application. Also note that the time point must match whatever zero time you get from ecore_time_get() and ecore_loop_time_get() (same 0 point). What this point is is undefined, sou unless your source uses the same 0 time, then you may have to adjust and do some guessing.

See also
  ecore_animator_custom_tick()
  ecore_loop_time_get()

Since
  1.11

References ecore_time_get().