aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/examples/ecore_time_functions_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/examples/ecore_time_functions_example.c')
-rw-r--r--libraries/ecore/src/examples/ecore_time_functions_example.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libraries/ecore/src/examples/ecore_time_functions_example.c b/libraries/ecore/src/examples/ecore_time_functions_example.c
new file mode 100644
index 0000000..5fa5d60
--- /dev/null
+++ b/libraries/ecore/src/examples/ecore_time_functions_example.c
@@ -0,0 +1,32 @@
1#include <Ecore.h>
2#include <unistd.h>
3
4static Eina_Bool
5_timer_cb(void *data)
6{
7 printf("ecore time: %0.3f\n", ecore_time_get());
8 printf("loop time: %0.3f\n", ecore_loop_time_get());
9 printf("unix time: %0.3f\n", ecore_time_unix_get());
10 printf("\nSleep for 1 second...\n\n");
11 sleep(1);
12 printf("ecore time: %0.3f\n", ecore_time_get());
13 printf("loop time: %0.3f\n", ecore_loop_time_get());
14 printf("unix time: %0.3f\n", ecore_time_unix_get());
15
16 ecore_main_loop_quit();
17
18 return EINA_FALSE;
19}
20
21int main(int argc, char **argv)
22{
23 if (!ecore_init())
24 {
25 printf("ERROR: Cannot init Ecore!\n");
26 return -1;
27 }
28
29 ecore_timer_add(0.1, _timer_cb, NULL);
30 ecore_main_loop_begin();
31 ecore_shutdown();
32}