If you take version 4, stop the first while loop once the size is at most 32, and then do linear search from there, it's faster (on my machine). For example, version 4 is 102ms and this tweak puts it at 83ms. (On clang x64.)
I didn't bother to test in anything besides Chrome on Mac. I was going to put in an audio alarm, but then I'd have to put in a button to disable audio, then I'd have to make it look pretty, and find a good alarm sound.
That feature is on my todo list, as well as email notification, persistent countdowns (you go to /23h and it'll redirect you to a permalink for that timer), email/SMS notification. Next time I have an hour to dedicate to this, I'll them done.
I always have a browser open, so being able to see the countdown status in the titlebar was sufficient for my needs. If I really wanted something to alert me, I'd use my phone in case I step away from my computer.
EDIT:
Yeah, looks like Firefox performs awfully with this.
I should have phrased as "what is the minimum number of characters that need to be seen by a Ruby parser in order to have something Turing equivalent to Ruby without a limited character set?"
But what's in that string? That still counts. What I should have done was put an additional restriction on what IO is available. Otherwise, something like "eval `cat f`" or something could be all powerful.
When I say "Turing complete", I mean Turing equivalent to a Turing machine. Since there are infinitely many Turing machines but I'm pretty sure humanity has access to a finite amount of state. I mean it strictly in the theoretical sense.
TeX is very Turing complete. As is Java sans semicolons, C macros, and many other things that probably shouldn't be. Right now, I'm trying to figure out what the minimum number of characters you need in Ruby is to make it Turing complete. I'm pretty sure that if you restrict yourself to under 12 characters, it's still possible.
I tried to do a little bit better of a job explaining it above. I was caught off guard... I intended to post this in a few days with a proper explanation.
As the original author of this, I was going to put it into a much more presentable state before showing it off here.
For those confused, here's a proper explanation. No real-world thing can actually be Turing complete (able to express basically any computation that we might want to perform of any size). That's because there are finitely many atoms in the universe, so we can only construct machines of finite size.
It's well known that Rule 110 (Google it) is Turing Compete.
What I've done is made an implementation of Rule 110 in HTML and CSS. Since CSS can't actually really manipulate state, some user interaction is required to "drive" it. In the one that bgruber linked to, it's clicking.
Here's a bigger version that doesn't require the user to know where to put his mouse. The tab-space combo is just as legitimate as requiring that you plug a computer into a wall to power it in order to run a Java program. http://elilies.com/rule110-full.html
Also, I haven't tested it on anything besides the latest Chrome on Mac.
ActiveRecord (Rails) provides counter caches for this instance. There are also gems that will analyze the queries your ORM performs to tell you which ones you should optimize.
I tend to stick with "premature optimization is the root of all evil".