The way the time machine in Primer worked, once activated, they formed a closed "loop" between the starting and ending points. An object in the timeline was continually moving forward and backward within that closed loop. In essence, the object would get to one end of the loop -- where the device transitions from "on" to "off" -- and if it didn't exit the box, it would just bounce backwards and travel to the other end.
Each time the object reached one of the endpoints, there was a probability that the loop would collapse on itself, and the object would exit the device. This probability appears to increase the longer the object is inside. From the outside, of course, the object always exits the device, because eventually the probability will reach one, but the object may have made many trips back and forth.
Aaron and Abe calculate that one minute of "outside time" spent in the device, on average, results in ~1340 minutes spent inside, but it could be much higher (probably as many as 10,000 minutes.) That means that, if the fungus secreted protein at a constant rate, in order to accumulate 5 years worth of protein would only take, on average, about a day and a half, and could take as little as 4 hours, in the machine. In the movie, it actually takes about 5 days to secret 5-6 years of protein -- more than enough time.
The breakthrough in using the box was figuring out how to force the channel to collapse on demand from inside; this is how the humans were able to use the device without aging decades at a time. They could compute exactly when they were about to reach the appropriate endpoint and exit at will.