// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Trick {
    private static final int REP = 5;
    private static final int N = 1000000000;
    public static void main(String[] args) {
        System.out.println("!");
        for(int i = 0; i < REP; i++) {
            boolean tmp = true;
            long t1 = System.currentTimeMillis();
            for(int j = 0; j < N; j++) {
                tmp = !tmp;
            }
            long t2 = System.currentTimeMillis();
            System.out.println(tmp + " " + (t2-t1));
        }
        System.out.println("^=");
        for(int i = 0; i < REP; i++) {
            boolean tmp = true;
            long t1 = System.currentTimeMillis();
            for(int j = 0; j < N; j++) {
                tmp ^= true;
            }
            long t2 = System.currentTimeMillis();
            System.out.println(tmp + " " + (t2-t1));
        }
    }
}
