The idea in that code is correct, but there is a small bug.
Move line 33
prevMillis = currMillis;
to just before line 29
prevMillis = currMillis;
OutputToSerial = true;
prevMillis should be the last time you printed out a line, not the last time the loop ran.