Can I get the time remaining on the glib event? ''

I create an event with g_timeout_addor g_timeout_add_secondsthat returns the event identifier; I can cancel the event by calling g_source_remove.

However, at some point I would like to see how much time is left until the event is fired. Is there an easy way to do this using the glib api, or do I need to manually store and compare timestamps with g_source_get_current_time?

+5
source share
2 answers

There is no sensible way to do this in GLib.

GSource (g_main_context_find_source_by_id), source- > source_funcs- > prepare() GSource, , . : source_funcs , prepare() , .

, . .

+3

+ -, , .

+2

All Articles