power: move broadcast suspend/resume into power module
[platform/core/system/deviced.git] / src / shared / time.c
1 #include <time.h>
2
3 #include "log-macro.h"
4 #include "common.h"
5
6 long clock_gettime_to_long(void)
7 {
8         struct timespec now;
9         int ret;
10
11         ret = clock_gettime(CLOCK_REALTIME, &now);
12
13         if (ret < 0) {
14                 _E("Failed to clock gettime!");
15                 return 0;
16         }
17
18         return SEC_TO_MSEC(now.tv_sec) + NSEC_TO_MSEC(now.tv_nsec);
19 }
20