This demo incorrectly calculates foreground time by just using performance.now(), failing to exclude time spent in the background.
performance.now()