Slowing down the CallbackProperty update function

Hi,

const redLine = ref.current.cesiumElement.entities.add({
        polyline: {
          positions: new CallbackProperty(function (time, result) {
            if (i < sample_polyline_points["points"].length) {
              if(i > 1) {
                startLng = sample_polyline_points["points"][i - 1]["lng"]
                startLat = sample_polyline_points["points"][i - 1]["lat"]
              }
              endLng = sample_polyline_points["points"][i]["lng"]
              endLat = sample_polyline_points["points"][i]["lat"]
              
              ref.current.cesiumElement.camera.flyTo({
                destination: Cartesian3.fromDegrees(
                  endLng,
                  endLat,
                  200
                ),
                duration: 0
              })

              i += 1
            }
            return Cartesian3.fromDegreesArray([startLng, startLat, endLng, endLat], Ellipsoid.WGS84, result)
          }, isConstant),
          width: 15,
          material: Color.RED,
          clampToGround: true,
          zIndex: new ConstantProperty(5)
        }
      })

I have the above code that updates the polyline per different coordinates. The only problem I am having is that it is updating too fast. I would like to at least give each update a few seconds before the next one. Is it possible to do that? Also, is it possible to loop the entire update again and again once it ends? Thanks