 0
            });
        });

        let startTime = Date.now();
        let earthDays = 0;
        let fps = 0;
        let frames = 0;
        let lastFpsUpdate = Date.now();
        let fpsAvg = 0;

        worker.onmessage = function (e) {
            planets = e.data;
        };

        function animate() {
            const currentTime = Date.now();
            const elapsedTime = (currentTime - startTime) / 1000; // in seconds
            earthDays = Math.floor((elapsedTime * 10) / (86400 / 10) *