const GnomeDesktop = imports.gi.GnomeDesktop;

function sleep(milliseconds) {
  var start = new Date().getTime();
  for (var i = 0; i < 1e7; i++) {
    if ((new Date().getTime() - start) > milliseconds){
      break;
    }
  }
}

var clock = null;
while (true) {
	clock = new GnomeDesktop.WallClock();
	sleep(1000);
	clock.run_dispose();
	clock = null;
}
