 <p>Make the first timeout with the offset for the hour.</p> <pre><code>setTimeout(worker,3600000 - ((new Date) % 3600000)) </code></pre> <p>This will be somewhat accurate (Date object construction might take some milliseconds).</p>