mytime.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*******************************************************************************
  2. License:
  3. This software and/or related materials was developed at the National Institute
  4. of Standards and Technology (NIST) by employees of the Federal Government
  5. in the course of their official duties. Pursuant to title 17 Section 105
  6. of the United States Code, this software is not subject to copyright
  7. protection and is in the public domain.
  8. This software and/or related materials have been determined to be not subject
  9. to the EAR (see Part 734.3 of the EAR for exact details) because it is
  10. a publicly available technology and software, and is freely distributed
  11. to any interested party with no licensing requirements. Therefore, it is
  12. permissible to distribute this software as a free download from the internet.
  13. Disclaimer:
  14. This software and/or related materials was developed to promote biometric
  15. standards and biometric technology testing for the Federal Government
  16. in accordance with the USA PATRIOT Act and the Enhanced Border Security
  17. and Visa Entry Reform Act. Specific hardware and software products identified
  18. in this software were used in order to perform the software development.
  19. In no case does such identification imply recommendation or endorsement
  20. by the National Institute of Standards and Technology, nor does it imply that
  21. the products and equipment identified are necessarily the best available
  22. for the purpose.
  23. This software and/or related materials are provided "AS-IS" without warranty
  24. of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
  25. NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
  26. or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
  27. licensed product, however used. In no event shall NIST be liable for any
  28. damages and/or costs, including but not limited to incidental or consequential
  29. damages of any kind, including economic damage or injury to property and lost
  30. profits, regardless of whether NIST shall be advised, have reason to know,
  31. or in fact shall know of the possibility.
  32. By using this software, you agree to bear all risk relating to quality,
  33. use and performance of the software and/or related materials. You agree
  34. to hold the Government harmless from any claim arising from your use
  35. of the software.
  36. *******************************************************************************/
  37. #ifndef _MYTIME_H
  38. #define _MYTIME_H
  39. /* this file needed to support timer and ticks */
  40. /* UPDATED: 03/16/2005 by MDG */
  41. #ifdef TIMER
  42. #include <sys/types.h>
  43. #endif
  44. #ifdef __MSYS__
  45. #include <sys/time.h>
  46. #else
  47. #include <sys/times.h>
  48. #endif
  49. #ifdef TIMER
  50. #define set_timer(_timer_); \
  51. { \
  52. _timer_ = ticks();
  53. #else
  54. #define set_timer(_timer_);
  55. #endif
  56. #ifdef TIMER
  57. #define time_accum(_timer_, _var_); \
  58. _var_ += (ticks() - _timer_)/(float)ticksPerSec(); \
  59. }
  60. #else
  61. #define time_accum(_timer_, _var_);
  62. #endif
  63. #ifdef TIMER
  64. #define print_time(_fp_, _fmt_, _var_); \
  65. fprintf(_fp_, _fmt_, _var_);
  66. #else
  67. #define print_time(_fp_, _fmt_, _var_);
  68. #endif
  69. extern clock_t ticks(void);
  70. extern int ticksPerSec(void);
  71. extern clock_t total_timer;
  72. extern float total_time;
  73. extern clock_t imap_timer;
  74. extern float imap_time;
  75. extern clock_t bin_timer;
  76. extern float bin_time;
  77. extern clock_t minutia_timer;
  78. extern float minutia_time;
  79. extern clock_t rm_minutia_timer;
  80. extern float rm_minutia_time;
  81. extern clock_t ridge_count_timer;
  82. extern float ridge_count_time;
  83. #endif