adding code for timing atomic functions