This is for a loading screen and I want to observe how long it takes. I've read that Every X second is based on real-world time and not ticks but I notice a "pause" on long function calls.
Below is a simplified version of my code:
Count = 0
Start of layout
-> Run = false
-> Count = 1
Count = 1 -> ajax request
On AJAX complete -> Run = true
Run = true, trigger once //modifying array of X=1000 size per call
-> call function(1)
-> call function(2)
-> call function(3)
-> call function(4)
Every X Second -> add 1 to Count
---------
After 3 seconds real time...
Expected result: count = 4
Actual result: count = 1 then only start adding after function calls finishes
What am I misunderstanding here?