Use the prepare_for_sleep
signal to calculate the time between suspend and resume.
Credits to @vjr for this tip!
- Install Vala Tester from elementary AppCenter
- Copy & paste all of the below code snippets in Vala Tester's code view
- Run the code in Vala Tester (click "
▶️ ") - this will open a new application window - Suspend & resume your computer
- Close the application window started by Vala Tester
- Now the sleep duration of your computer gets printed in Vala Tester's output view.