Want a Dialog to Show with Background Timer

While a user is on a page, I want a timer to run in the background checking a specific table for information, say every 5 minutes. If the table has information, I want to be able to then show a dialog box on that page with that information.

The basic idea is that the dialog warns the user of upcoming system outages.

Does anyone have an idea how I can implement something like this.

I've got the dialog working with:

I just need the timer to allow me to launch the dialog now. If there's a better way, I'm open to that as well

Found this lovely post, don't know how I missed it the first time.