approx_time.h 567 B

12345678910111213141516171819202122232425
  1. /* Copyright (c) 2003-2004, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. /**
  6. * \file approx_time.h
  7. * \brief Header for approx_time.c
  8. **/
  9. #ifndef TOR_APPROX_TIME_H
  10. #define TOR_APPROX_TIME_H
  11. #include <time.h>
  12. /* Cached time */
  13. #ifdef TIME_IS_FAST
  14. #define approx_time() time(NULL)
  15. #define update_approx_time(t) STMT_NIL
  16. #else
  17. time_t approx_time(void);
  18. void update_approx_time(time_t now);
  19. #endif /* defined(TIME_IS_FAST) */
  20. #endif