2013-02-08 09:35:17 -08:00
|
|
|
//Compile with:
|
|
|
|
// gcc -o ecore_time_functions_example ecore_time_functions_example.c `pkg-config --libs --cflags ecore`
|
|
|
|
|
2012-12-03 11:36:16 -08:00
|
|
|
#include <Ecore.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
static Eina_Bool
|
2014-01-08 23:33:20 -08:00
|
|
|
_timer_cb(void *data EINA_UNUSED)
|
2012-12-03 11:36:16 -08:00
|
|
|
{
|
|
|
|
printf("ecore time: %0.3f\n", ecore_time_get());
|
|
|
|
printf("loop time: %0.3f\n", ecore_loop_time_get());
|
|
|
|
printf("unix time: %0.3f\n", ecore_time_unix_get());
|
|
|
|
printf("\nSleep for 1 second...\n\n");
|
|
|
|
sleep(1);
|
|
|
|
printf("ecore time: %0.3f\n", ecore_time_get());
|
|
|
|
printf("loop time: %0.3f\n", ecore_loop_time_get());
|
|
|
|
printf("unix time: %0.3f\n", ecore_time_unix_get());
|
|
|
|
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2014-01-08 23:33:20 -08:00
|
|
|
main(void)
|
2012-12-03 11:36:16 -08:00
|
|
|
{
|
|
|
|
if (!ecore_init())
|
|
|
|
{
|
|
|
|
printf("ERROR: Cannot init Ecore!\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
ecore_timer_add(0.1, _timer_cb, NULL);
|
|
|
|
ecore_main_loop_begin();
|
|
|
|
ecore_shutdown();
|
|
|
|
}
|
|
|
|
|