Monday, November 08, 2010 at 12:02 AM.


on timerExpired (processname, ctSecsBetwRuns=60) {
		<<12/28/01; 6:31:42 PM by DW
			<<Created. Return true if the timer expired, false otherwise.
	local (adrtable = @system.temp.timers);
	if not defined (adrtable^) {
		new (tabletype, adrtable)};
	local (adrtimer = @adrtable^.[processname]);
	if not defined (adrtimer^) {
		adrtimer^ = ();
		return (true)}; //run the process
	if ( () - adrtimer^) >= ctSecsBetwRuns {
		adrtimer^ = ();
		return (true)}; //run the process
	return (false)} //it hasn't expired yet
<<bundle //test code
		<<if timerExpired ("test", 2)
			<<speaker.beep ()

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.