Added function similar to gettime but waits until a specified amount of time has passed instead.