I find this method to be quite accurate:
PHP Code:
//place within a 0.05 second timeout
function handleTimeVar(){
if(this.time != timevar){
this.time = timevar;
this.tv2 = this.time * 5;
this.timechange = timevar2;
}
}
public function getTimevar3(){
return 981048814 + this.tv2 + timevar2 - this.timechange;
}
When I trigger to the server to compare the difference it's always about 0.25 seconds behind serverside timevar2, which would include the delay caused by latency.