How can i make a delay function like the one in pascal ??