Use CPU time instead of wall time for time limit.

Fixes #1279.