Call function when clock advances by 1 second

Hi, I’m creating a simple satellite tracking application that generates a point cloud around the globe based off of data from norad. I want to know if there’s something I can hook into to update the position of each satellite based off of cesium’s internal clock. I already tried adding an event listener to the viewmodel’s clock.tick event but I saw that there was a gradual slowdown when I did that as well as tick running faster than I needed. I saw in the documentation that AnimationViewModel - Cesium Documentation is observable so I would like to subscribe to that property but javascript says that timeLabel doesn’t have a property named subscribe. I would really appreciate any help I could get

my code’s repository is at GitHub - Withenex/satelliteTracker: Uses satellite data from celestrak and satellite.js to track satellites

You’re coming at this from the wrong direction. If you need to get new position data periodically, there’s no reason to hook into simulated time, you can simply use setTimeout / setInterval etc. If you already know all the position data, and want the satellites to appear in the correct location based on simulated time, you should use a time-variant PositionProperty, like SampledPositionProperty. (I also use CallbackProperty to dynamically compute positions but technically that’s not officially supported.)

I appreciate the help, but i’m trying to change from computing the position as needed to using a sampled position property instead and adding samples inside of a setInterval. I used the flight tracker example as a reference but whenever I add a sample to the scene all my points dissapear. If i set viewer.clock.currentTime to the sampled time All the satellites appear as they should. It looks like whenever I add a sample my previous samples dissapear?

Did you add the code to use SampledPositionProperty recently? I don’t see any references to it in your linked project, you’re just reassigning the position 60 times per second, which will definitely be a bad experience. Can you post an example of the sample-based approach you’re trying to do?