Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- private static int zm = 0;
- private static Runnable r = () -> {
- for (int i = 0; i < 10_000_000; ++i) {
- zm++;
- }
- };
- public static void main(String[] args) throws InterruptedException {
- Thread t = new Thread(r);
- long start = System.nanoTime();
- t.start();
- t.join();
- long stop = System.nanoTime();
- System.out.println("time = " + ((stop - start) / 1e9));
- System.out.println("zm = " + zm);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement