Use millis(). Remember the value it returns on the frame you start displaying the text. When the value it returns has increased by 2000, two seconds have elapsed, and you can thus stop displaying it.
int time;
void setup(){
size(200,200);
time = millis();
}
void draw(){
background(0);
if( millis() < time + 2000){
text("BOOP", 20, 20);
}
}
Answers
Use millis(). Remember the value it returns on the frame you start displaying the text. When the value it returns has increased by 2000, two seconds have elapsed, and you can thus stop displaying it.
thank you...
this is a FAQ:
https://forum.processing.org/two/discussion/8084/how-do-i-display-a-message-for-a-few-seconds