Meddling with the runtime clock

I use code like this in the Bitlash rollover example (bitlash/rollover.ino at master · billroy/bitlash · GitHub):

extern volatile unsigned long timer0_millis;

void setMillis(unsigned long newtime) {
	uint8_t oldSREG = SREG;
	cli();
	timer0_millis = newtime;
	SREG = oldSREG;
})

-br