Saturday, November 03, 2007

A Quick Estimate

I was trying to estimate how long it would take for a timer, measured in nano-seconds using 64 bits would take to roll over. Here's my quick estimate

It would take 2^64/10^9 seconds = 2^64/2^9*5^9

Approximating on all calculations

= 2^55/5^9

5^3 = 125 ~= 2^7
5^9 = 2^21

= 2^55/2^21

= 2^34 seconds

2^34 seconds = 2^34/86500 days ~= 2^34/80*2^10 = 2^24/2^6 days = 2^18 days

1 year = 365 days, 3 years ~= 2^10 days

That leaves us with 2^8 years * 3 years

= 256*3 years before the timer overflows

With a machine, usually one would expect at-least one reboot in 800 years, if so, we would be fine for a long time to come.

See I need no calculator :-)

No comments:

Ranking and Unranking permutations

I've been a big fan of Skiena's Algorithm Design Manual , I recently found my first edition of the book (although I own the third ed...