For each target time you will need a separate variable to store the elapsed time in. That gets complex.
You could either have it as a class, where each instance of the class is a time you want to test for, or pass a variable by reference to the function to use.
The latter is "lighter", and could look something like (untested):
boolean timeElapsed(unsigned long dt, unsigned long *time)
{
unsigned long now = millis();
if (time == 0) {
time = now;
return false;
}
if (now - time >= dt) {
time = now;
return true;
}
return false;
}
void something()
{
unsigned long myTime = 0;
while (!timeElapsed(3000, &myTime))
continue;
digitalWrite(13,HIGH);
}