util to measure memory latency