Implement spent time tracking

VERSION2: make it robust for consecutive saves.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>