I have a function that could be called many times, but I don\'t want it to be executed more than once per frame. What\'s the best way of implementing that?