How to delay the execution of this function?

function questionGen()

 local questionVar1 = display.newImage(“ygSquare.png”, 150, 500); 

 local var1 = math.random(1,9)

 local var1Display =display.newText(var1, 150, 500, native.systemFont, 200)

 questionVar1.width = 200

 questionVar1.height = 200

 var1Display:setTextColor("#000000")

 local questionVar2 = display.newImage(“blueSquare.png”, 550, 500);

 local var2 = math.random(1,9)

 local var2Display = display.newText(var2, 550, 500, native.systemFont, 200)

 questionVar2.width = 200

 questionVar2.height = 200

 var2Display:setTextColor("#000000")

 local operator = "     +     =" 

 local operatorDisplay = display.newText(operator, 400, 500, native.systemFont, 200)

 operatorDisplay:setTextColor("#000000")

 local varAnswer = var1 + var2

 return varAnswer

 end

I created a CheckAnswer() function <---- CheckButton

in CheckAnswer() function i put questionGen() to it.

every time i click the CheckButton the questionGen always

reload, what i wanted to happen is to delay the execution and

reloading of questionGen()

questionGen() means generating of questions

-- timer.performWithDelay( delay, listener [, iterations] ) ---- local i = 1 local function listener( event ) print( i ) i = i + 1 end timer.performWithDelay( 1000, listener, 3 ) OUTPUT: 1 2 3
-- timer.performWithDelay( delay, listener [, iterations] ) ---- local i = 1 local function listener( event ) print( i ) i = i + 1 end timer.performWithDelay( 1000, listener, 3 ) OUTPUT: 1 2 3