How to compare GDKEvent timestamp with current time?

后端 未结 1 945
北荒
北荒 2021-01-24 13:20

How to use the GDKEvent\'s timestamp in c++? For example, I print it as unsigned int, its value is 4194719109, but the current time is 1395764110 which is gotten from time() of

1条回答
  •  死守一世寂寞
    2021-01-24 14:08

    The time element of GdkEvent is in miliseconds. Comparing with g_get_monotonic_time() (which is in µs) divided by 1000 should work (make sure to check the sign and cast to guint32 before comparing)

    0 讨论(0)
提交回复
热议问题