Detect a program how long it has run.