Functions as variables

In my project I need to switch between millis and micros delay depending on given timespan.

Instead of doing this in every loop
if (time < 1000) delayMicroseconds(…); else delay(…);

I’d like to do something like what I’d usually do in javascript
unsigned long = myDelay;
if (time < 1000) myDelay = delayMicroseconds; else myDelay = delay;
and then in loop I’d just call myDelay(…);

Is something like that possible?

Yes, perfectly possible - google "C function pointer"

Edit: Slight difficulty: "delay" and "delayMicroseconds" take different arguments. ("unsigned long" vs. "unsigned int").

Why not just create a function called myDelay() and have it decide whether to call delay() or delayMicroseconds()? Don’t make the solution more complicated than the problem.