The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>Comet echo RPC</title>
        <link rel="stylesheet" type="text/css" href="chat/chat.css"></link>
        <script type="text/javascript" src="../dojo/dojo/dojo.js.uncompressed.js"></script>
        <script type="text/javascript" src="../dojo/dojox/cometd.js.uncompressed.js"></script>
        <script type="text/javascript">
            dojo.require("dojox.cometd");
            dojo.require("dojox.cometd.timesync");

            dojox.cometd.init(new String(document.location).replace(/http:\/\/[^\/]*/,'').replace(/\/examples\/.*$/,'')+"/cometd");
            dojox.cometd.subscribe("/chat/demo", function(){});

            var tick=function(){
	    	var now=dojox.cometd.timesync.getServerDate();
	    	dojo.byId("time").innerHTML=now.toUTCString();
                dojo.byId("offset").innerHTML=dojox.cometd.timesync.offset+"  from samples "+dojox.cometd.timesync._offsets.join();
		now=now.getTime();
		var next=""+(1+now/1000);
		next=parseInt(next.split('.')[0])*1000+10;
		dojox.cometd.timesync.setTimeout(tick,next);
	    }

            setTimeout(tick,1000);
        </script>
    </head>
    <body>
        
        <h1>TimeSync test</h1>
        <p>
            This test uses the timesync extension to calculate a timeoffset with the server.
	    The time displayed below is the server time and should be the same for all clients no matter what their local clocks are set to. 
	    The accuracy should improve as each connect response is received.
        </p>
        <div id="time">
        </div>
	<br/>
        offset=<span id="offset">
        </span>
    </body>
</html>