I have the following code.. 

```
 public static void main(String[] args) {
            int i = 1234;
            int j = 1234;
            int k = 4321;
            long l1 = System.nanoTime();
            if (i == j) {
                System.out.println("equal");
            }
            System.out.println(System.nanoTime() - l1);
            l1 = System.nanoTime();

            if (i != k) {
                System.out.println("equal");
            }

            System.out.println(System.nanoTime() - l1);
            l1 = System.nanoTime();

            if (i == k) {
                System.out.println("equal");
            }

            System.out.println(System.nanoTime() - l1);

            l1 = System.nanoTime();

            if (i != j) {
                System.out.println("equal");
            }
            System.out.println(System.nanoTime() - l1);

        }

```

Now when I run this program, the OPs are:

```
1. 
equal
190295
equal
22237
427
0

2. 
equal
156512
equal
18388
0
428

3. 
equal
155656
equal
20099
0
0

```

My question : how is it that the time taken for execution is "0" ??.. If the compiler does some optimization, then why doesn't it do it always?. I think the "0" is because that statement wasnt executed by the compiler.