prova così:

tempo = getTimer();

if (tempo <= 3000) {
nextFrame;
} else {
prevFrame;
}