Call function from Setup

In the following code I call function "void runGPS()" from "void setup()" as I only need to run this function once.
For some reason the function runGPS() is not being called from within void setup().
However, if I call the function runGPS() from "void loop()" all is OK and runGPS() is called.My Sketch:

int min = 5;
int sec =  60 * min;;
unsigned long oneSecond = 1000UL;
unsigned long startTime;

void setup() {
  Serial.begin(115200);

  Serial.println("Start GPS");
  runGPS();
}
//----------------------------------------------------
void loop()
{
  //  runGPS();
}

void runGPS() {
  if (millis() - startTime >= oneSecond)
  {
    sec--;
    startTime += oneSecond;
    if (sec < 0) stopGPS();
    int displayMin = sec / 60;
    if (displayMin < 10) Serial.print("0");
    Serial.print(displayMin);
    Serial.print(":");
    int displaySec = sec % 60;
    if (displaySec < 10) Serial.print("0");
    Serial.println(sec % 60);
  }
}

void stopGPS()
{
  Serial.println("Stopped GPS");
  while (1)
  {

  }
}

You need to initialise the start time to the current millis() before you use the start time. Then wait for at least a second before calling runGPS() since the first thing that runGPS() does is to make sure that a second or more has elapsed since the start.

Why do you need to check that a second has passed ?

It does get called, but millis() has not had time to even count to 1 so it immediately returns.

Thanks all.
If I add the following to Setup:

  startTime = millis();
  delay(1500);
  runGPS();

My function "void runGPS()" is called.
But it only "counts-down" once.
On my Serial Monitor I get:

Start GPS
04:59

I should get:

Start GPS
04:59
04:58
.
.
.
00:00
Stopped GPS

My idea is to start the GPS module on Power-On.
Switch the GPS module ON for 5 minutes.
Then after 5 minutes, switch the GPS module OFF.

I will modify the Sketch so that "void runGPS()" will only be called when the GPS module has obtained initial Fix.

My final Sketch will:
1). Switch GPS ON (Mosfet switch circuit)
2). Parse NMEA string
3). When Valid data "Fix" is obtained
4). Run GPS for a further 5 minutes.
5). Switch GPS OFF (Mosfet switch circuit)

This is necessary to ensure that the GPS downloads all ephemeris data.
My above is simply a test to see that I call functions correctly.

Seems to me that your runGPS() function needs to be run in loop() and not setup() since setup() is only ever activated once! If you need to apply further restrictions as to when run GPS() should run then they should be implemented within loop() .

You have made a very complicated code that could be replaced by a single line of code..

delay(300000);

Since you gave no indication you needed to do anything else in the background during that time, “KISS”.

Eish - typical case of "can't see the wood for the trees"
@Slumpert - you are absolutely correct - the GPS just downloads for the 5 minutes and the micro does not do anything.