code: public static void limitLife(final long lifetimeMs) {
      new Thread(() -> {
        CommonUtils.sleepMs(lifetimeMs);
        LOG.info("Process has timed out after {}ms, exiting now", lifetimeMs);
        System.exit(-1);
      }, "life-limiter").start();
    }
docs: Launches a thread to terminate the current process after the specified period has elapsed.
  
  @param lifetimeMs the time to wait before terminating the current process