[gnome-desktop/ebassi/update-for-gtk4: 7/23] Remove use of GTimeVal




commit 0511230a0a9e069cbce78ec8115c7ed08b4068b3
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Oct 26 17:55:57 2021 +0100

    Remove use of GTimeVal
    
    GTimeVal is not Y2038-safe, and has been deprecated in GLib.

 libgnome-desktop/gnome-bg-crossfade.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg-crossfade.c b/libgnome-desktop/gnome-bg-crossfade.c
index f254b313..34aa60c2 100644
--- a/libgnome-desktop/gnome-bg-crossfade.c
+++ b/libgnome-desktop/gnome-bg-crossfade.c
@@ -298,16 +298,7 @@ gnome_bg_crossfade_set_start_surface (GnomeBGCrossfade *fade,
 static gdouble
 get_current_time (void)
 {
-       const double microseconds_per_second = (double) G_USEC_PER_SEC;
-       double timestamp;
-       GTimeVal now;
-
-       g_get_current_time (&now);
-
-       timestamp = ((microseconds_per_second * now.tv_sec) + now.tv_usec) /
-                   microseconds_per_second;
-
-       return timestamp;
+        return (double) g_get_real_time () / 1000000.0;
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]