I'm out of memory? Is the next thing up the Mega644P?

jerseyguy1996:
I believe mathematically is equivalent to your code. I could be wrong though.

It is equivalent, except that your version doesn't handle counter rollover correctly.