I sometimes find myself putting a VM in "Save" mode or "Sleep" mode. Invariably, I'm curious as to how long these VMs end up being down- for example, when a Linux VM is hosted on Hyper-V and backed up with DPM, the VM is paused for a few seconds while a snapshot is taken. I've seen these VMs take between 20 and 55 seconds to go down and come back up. How do I know how long they were down?
while true; do date | tee -a ~/date.txt; sleep 1; done