Help with programming a tester!

Ok! How should I use a timing function? Do you have any examples?