michael@0: var timer = null; michael@0: michael@0: function handleRequest(request, response) michael@0: { michael@0: response.processAsync(); michael@0: timer = Components.classes["@mozilla.org/timer;1"] michael@0: .createInstance(Components.interfaces.nsITimer); michael@0: timer.initWithCallback(function() michael@0: { michael@0: response.setStatusLine(null, 200, "OK"); michael@0: response.setHeader("Content-Type", "text/plain", false); michael@0: response.write("hello"); michael@0: response.finish(); michael@0: }, 3000 /* milliseconds */, Components.interfaces.nsITimer.TYPE_ONE_SHOT); michael@0: }