Groovy wait time

Code examples

1
0

groovy wait time

class TestMultiThreadSleep implements Runnable {
   String name;
   public TestMultiThreadSleep(String name) {
      this.name = name;
   }
   static void main(String[] args) {
      Thread thread1 = new Thread(new TestMultiThreadSleep("A"));          
      Thread thread2 = new Thread(new TestMultiThreadSleep("B"));
      Thread thread3 = new Thread(new TestMultiThreadSleep("C"));
      thread1.start();
      thread2.start();
      thread3.start();
    }
   @Override
   public void run() {
      println "${name} Step 1"
      sleep(3000)
      println "${name} Step 2"
      sleep(3000)
      println "${name} Step 3"      
   }
}

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

Popular in the category

Popular pages with examples in the category