Running function 5 seconds after pygtk widget is shown

后端 未结 2 1095
不知归路
不知归路 2020-12-14 23:12

How to run function 5 seconds after pygtk widget is shown?

2条回答
  •  一个人的身影
    2020-12-14 23:39

    If the time is not critical to be exact to the tenth of a second, use

    glib.timeout_add_seconds(5, ..)
    

    else as above.

    timeout_add_seconds allows the system to align timeouts to other events, in the long run reducing CPU wakeups (especially if the timeout is reocurring) and save energy for the planet(!)

提交回复
热议问题