You mean for a specific amount of time from last reset or from a button press etc? As far as I know, millis() starts counting from zero after power on.
In any case, I would make the function define the action it should do and nothing more, and then have the running condition of that function in loop().
if (millis() - startTime < totalTime*1000*60)
Where startTime has been initialized either to 0, or millis() at a specific event depending on what you want to trigger it. I assume you mean this variable to contain this info, so take it out of myCount(). It should be initialized somewhere else, not all the time. The function myCount would get called for totalTime [minutes] in a loop.