PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ThreadsSynchronization/Sender.java

https://bitbucket.org/Marin_Abaluta/exercitiul_15
Java | 23 lines | 14 code | 9 blank | 0 comment | 0 complexity | 04ef62ca9e3f2225c1458fd510c10493 MD5 | raw file
 1package ThreadsSynchronization;
 2
 3import com.sun.org.apache.xpath.internal.SourceTree;
 4
 5public class Sender {
 6
 7    public void send(String message) {
 8
 9        System.out.println("Sending " + message);
10
11        try {
12            Thread.sleep(1000);
13        } catch (InterruptedException x) {
14            System.out.println("Interrupted");
15        }
16
17        System.out.println(message);
18        System.out.println("Sent");
19
20    }
21
22
23}