\hypertarget{ecore_time_functions_example_8c-example}{}\doxysection{ecore\+\_\+time\+\_\+functions\+\_\+example.\+c}
Shows the difference between the three time functions. See \mbox{\hyperlink{ecore_time_functions_example_c}{the example explained}}.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{// gcc -\/o ecore\_time\_functions\_example ecore\_time\_functions\_example.c `pkg-\/config -\/-\/libs -\/-\/cflags ecore`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <unistd.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_timer\_cb(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}ecore time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_ga98f2439b5d3e7114a75bfe2f0c22c4e9}{ecore\_time\_get}}());}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}loop time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_gab53d952cc4c2f3ed032d535b307c43bd}{ecore\_loop\_time\_get}}());}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}unix time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_ga0b8030aa39eb3701b6b30816ee9c45df}{ecore\_time\_unix\_get}}());}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\(\backslash\)nSleep for 1 second...\(\backslash\)n\(\backslash\)n"{}});}
\DoxyCodeLine{   sleep(1);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}ecore time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_ga98f2439b5d3e7114a75bfe2f0c22c4e9}{ecore\_time\_get}}());}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}loop time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_gab53d952cc4c2f3ed032d535b307c43bd}{ecore\_loop\_time\_get}}());}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}unix time: \%0.3f\(\backslash\)n"{}}, \mbox{\hyperlink{group__Ecore__Time__Group_ga0b8030aa39eb3701b6b30816ee9c45df}{ecore\_time\_unix\_get}}());}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}())}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}ERROR: Cannot init Ecore!\(\backslash\)n"{}});}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}}(0.1, \_timer\_cb, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}

\end{DoxyCodeInclude}
 