# Do some stuff $thread->new( ...); # start a thread sleep ...; # Sleep a while $thread->join; # Wait for the thread to finish. # do some other stuff.