Improved timing script