{
const size = 2 * settings.radius;
const svgNode = DOM.svg(5 * size, size);
yield svgNode;
d3.select(svgNode).call(addClock);
const counter = d3
.select(svgNode)
.append("text")
.style("font-size", `${settings.radius / 2}px`)
.style("transform", "translate(72px, 36px)");
const hoursFrom = 1.25;
const hoursTo = 10.5;
const interval = 4000;
const delayBeforeRestart = 1000;
const framesPerSecond = 60;
let running = true;
invalidation.then(() => (running = false));
while (running) {
const intervalWithDelay = interval + delayBeforeRestart;
let normalizedTime = (new Date().getTime() % intervalWithDelay) / interval;
normalizedTime = Math.min(1, normalizedTime);
const hours = interpolateHours(hoursFrom, hoursTo, normalizedTime);
counter.text(`Normalized time: ${normalizedTime.toFixed(2)}`);
d3.select(svgNode)
.datum(hours)
.call(updateClock);
await Promises.tick(1000 / framesPerSecond);
}
}