Make sure your calculations all use unsigned long variables (32bit, 0 to FFFFFFFF)
and the math is always currentmilis - previous millis.
Then even at rollover, if currentmillis = 0x00001000, and older (previous) is 0xFFFFFFF8 for instance, a correct result is returned:
0x00001000 - 0xFFFFFFF8 = 0x00001008