Counter / timer

how can i get a script that will count 10 seconds or whatever number and then perform a function

if (counter==10seconds){
do_this();
}