What is the difference between pros::delay() and pros::Task::delay()? I looked in the pros 3 api documentation, but I could only find an explanation for pros::Task::delay(). I’ve always used pros::delay() for everything, but I’ve never known the difference.
Thank you for your reply, but why are there two functions if they accomplish the same task?
Also, I tried to post this question under the “PROS Support” category, but the option wasn’t available, and when I tried to create a new topic directly from that category, it said that I’m not allowed to create topics under that category. Could someone please explain why this is?
While I may not know all of the details of each function, I know that Task::delay() is used within a Task in Pros. This allows you to delay inside the task without delaying the entire program. I believe delay() on the other hand delays the entire program. That’s a very rough explanation, but I think that’s the basic idea of why there are two functions for delaying. I would say most use cases will just require delay().
Just to clarify for anyone reading this in the future.
They are the same, PROS has had quite a long development cycle and has evolved over the years. The C++ class Task was added at some point and had the new delay() member function, pros::delay() was kept presumably for backwards compatibility with existing code.