How do I make a delay function (e.g like the one in Pascal) ??