libweston: Use struct timespec for compositor time

Change weston_compositor_get_time to return the current compositor time
as a struct timespec. Also, use clock_gettime (with CLOCK_REALTIME) to
get the time, since it's equivalent to the currently used gettimeofday
call, but returns the data directly in a struct timespec.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/libweston/compositor.c b/libweston/compositor.c
index c130d92..7d7a17e 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1721,14 +1721,10 @@
 	surface_set_size(surface, width, height);
 }
 
-WL_EXPORT uint32_t
-weston_compositor_get_time(void)
+WL_EXPORT void
+weston_compositor_get_time(struct timespec *time)
 {
-       struct timeval tv;
-
-       gettimeofday(&tv, NULL);
-
-       return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+	clock_gettime(CLOCK_REALTIME, time);
 }
 
 WL_EXPORT struct weston_view *