mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 06:32:10 +01:00
tests: Stop using deprecated g_get_current_time()
Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #1438
This commit is contained in:
parent
161654681f
commit
de25be72f0
@ -361,13 +361,12 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
|
||||
SyncThreadData data1;
|
||||
SyncThreadData data2;
|
||||
SyncThreadData data3;
|
||||
GTimeVal start_time;
|
||||
GTimeVal end_time;
|
||||
gint64 start_time, end_time;
|
||||
guint elapsed_msec;
|
||||
|
||||
do_async = (n == 0);
|
||||
|
||||
g_get_current_time (&start_time);
|
||||
start_time = g_get_real_time ();
|
||||
|
||||
data1.proxy = proxy;
|
||||
data1.msec = 40;
|
||||
@ -397,10 +396,9 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
|
||||
g_thread_join (thread2);
|
||||
g_thread_join (thread3);
|
||||
|
||||
g_get_current_time (&end_time);
|
||||
end_time = g_get_real_time ();
|
||||
|
||||
elapsed_msec = ((end_time.tv_sec * G_USEC_PER_SEC + end_time.tv_usec) -
|
||||
(start_time.tv_sec * G_USEC_PER_SEC + start_time.tv_usec)) / 1000;
|
||||
elapsed_msec = (end_time - start_time) / 1000;
|
||||
|
||||
//g_debug ("Elapsed time for %s = %d msec", n == 0 ? "async" : "sync", elapsed_msec);
|
||||
|
||||
|
@ -66,14 +66,14 @@ socket_client_event (GSocketClient *client,
|
||||
GSocketConnection *connection)
|
||||
{
|
||||
static GEnumClass *event_class;
|
||||
GTimeVal tv;
|
||||
gint64 now_us;
|
||||
|
||||
if (!event_class)
|
||||
event_class = g_type_class_ref (G_TYPE_SOCKET_CLIENT_EVENT);
|
||||
|
||||
g_get_current_time (&tv);
|
||||
printf ("% 12ld.%06ld GSocketClient => %s [%s]\n",
|
||||
tv.tv_sec, tv.tv_usec,
|
||||
now_us = g_get_real_time ();
|
||||
g_print ("%" G_GINT64_FORMAT " GSocketClient => %s [%s]\n",
|
||||
now_us,
|
||||
g_enum_get_value (event_class, event)->value_nick,
|
||||
connection ? G_OBJECT_TYPE_NAME (connection) : "");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user