In a recent question, Yiannis Lazarides was asking about benchmarking loops. Strangely his results were about 800 times faster than mine. I couldn't quite accept that my computer is that outdated (as I only bought it a couple of months ago). The main difference seemed to be that I was compiling the file on Linux while he was compiling it on Windows. So I installed MikTeX on my Windows partition to try it myself and the result has quite surprised me.
This is a slightly simplified version of Yiannis' code (to be run with pdflatex)
\documentclass{article}
\usepackage{ifthen}
\def\startTimer{\pdfresettimer}
\def\stopTimer{\the\pdfelapsedtime\,scaled seconds}
\begin{document}
\startTimer
\newcounter{acount}
\whiledo{\value{acount}<888}{%
\stepcounter{acount}%
\theacount, }
\stopTimer
\end{document}
On Linux (Ubuntu 10.10 64bit, TeX Live 2010 (both 32bit and 64bit)) the timer reports about 1700 scaled seconds. On Windows (7, 64bit, MikTeX 2.9 (32bit?)) the result is 2 scaled seconds.
I am pretty sure that a factor of 850 is not solely attributable to the operating system (both tests are run on the same machine). Also, compiling a “real life” document seems to take about the same time on both operating systems. Where does the difference come from?
ftimeinaccuracy) is the sort of answer I was looking for. Additional testing shows that there is a huge jump in time at a certain (fixed!) amount of iterations, presumably when there is enough code executed between the two calls offtime. Could you please add that to your answer. – Caramdir Jan 17 '11 at 17:19