static void doWithNowSet(LocalRegion lr, Runnable runnable) {
    now.set(calculateNow(lr.getCache()));
    try {
      runnable.run();
    } finally {
      now.remove();
    }
  }
To reduce the number of times we need to call calculateNow, you can call this method to set now
in a thread local. When the run returns the thread local is cleared.
geode-core/src/main/java/org/apache/geode/internal/cache/ExpiryTask.java