content/hifi-content/caitlyn/scratch/domainTimePinger.js
2022-02-13 22:19:19 +01:00

25 lines
470 B
JavaScript

(function(){
var self=this;
var messageRate = 500;
function sendMessage(){
var d = new Date();
var n = d.getTime();
print("SENDER"+n);
Messages.sendMessage('domainTime',n)
}
this.preload = function(entityID) {
print("PRELOAD SENDER");
self.messageInterval = Script.setInterval(function(){
sendMessage();
},messageRate);
};
this.unload = function(){
Script.scriptEnding.connect(self.messageInterval);
};
}
);