Vala: How to avoid time offsets caused by hibernation
Use the prepare_for_sleep
signal to calculate the time between suspend and resume.
Credits to @vjr for this tip!
How to run this code
- Install Vala Tester from elementary AppCenter
- Copy & paste all of the below code snippets in Vala Tester's code view