Synchronized getTimestamp method