Point system avoiding lag

I'm attempting to make a basic idle incremental points system that runs on a datapack. It needs to grant x points per second where x is 4 scoreboard values multiplied by each other. I'm currently doing this with 4 functions that loop each other and execute the add points command thousands of times. Is there a less laggy way to do this like defining a variable within the datapack?

Continue to help post