6
Answers

Timestamp Access Time

David Smith

David Smith

6y
528
1
I noticed that you used a timestamp to keep track of your access time. If we ever multithread this cache or if we run on an operating system that does not have a high granularity timestamp this will cause the cache to run incorrectly. Can you refactor your logic so that this will work correctly under any circumstance.
 
I am using this below. How to refactor this to make sure this will work under any circumstance
 
public void UpdateAccessTime() => AccessTime = Stopwatch.GetTimestamp();
Answers (6)