Calculate time difference as seconds.