measuring execution time in nanoseconds