Creating a Pause Method in Java

I use this often in my robotics code. The reason is simple, it takes the robots time to do things and I need to wait for a microcontroller to perform some action, like get a sensor reading, or move a certain distance, or change heading. It’s very simple, but I will add more robotics code later this week-end, this is just the start.

public static void pause(long ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }