You can use System.currentTimeMillis() to get start and end times but
you should collect many many data points.
Because of the granularity of system time, a single reading does not mean much.
Doing ANY System.out writes while timing will completely mess up the measurement. Collect the data, average and then print.
Bill