-1

I am inserting records from an array to a system,since if the count of array records goes beyond 999 system will break , so i want to make the compiler sleep for 2 seconds once 998 records are processed , in Java ..how can I do the same? I am working in Gosu which is a technology similiar to Java 8 .Thanks in Advance

1 Answers1

2

You may want to use Thread.sleep().

try {
    Thread.sleep(2000); // 2 seconds
} catch (InterruptedException e) {
    // do something if necessary
}
MikeCAT
  • 73,922
  • 11
  • 45
  • 70