[Spice-devel] RFC: Time functions in Spice

Marc-André Lureau mlureau at redhat.com
Mon Dec 7 08:05:23 PST 2015


Hi

----- Original Message -----
> 
> So the Spice server has a red_get_monotonic_time() function which, as is
> the tradition, has a very similar name to a regular Glib function,
> g_get_monotonic_time(), except that one returns the time in nanoseconds
> and the other in microseconds and nothing in the name warns the
> developer of that difference. Also nothing in that function justifies
> the red_ prefix and it is used quite widely.
> 
> There is also reds_get_mm_time() which returns the time in milliseconds.
> But unlike implied by its name it is also used by sound.c, dcc-send.c
> and display-channel.c so I'm not sure the reds_ prefix is really
> justified.
> 
> So I propose to rename these functions to spice_nanosecond_time() and
> spice_millisecond_time() and to define both in utils.h. Would that be
> ok?

Why not use g_get_monotonic_time() everywhere? I don't think spice needs
nanosecond anyway.


More information about the Spice-devel mailing list