OSDN Git Service

Pull out commonly used constants to <audio_utils/clock.h>
authorGlenn Kasten <gkasten@google.com>
Fri, 8 Sep 2017 21:54:17 +0000 (14:54 -0700)
committerGlenn Kasten <gkasten@google.com>
Wed, 31 Jan 2018 17:57:42 +0000 (09:57 -0800)
Test: builds OK
Change-Id: Ib1167a6f4ebf4a416c9ca964fc46293e0d0597d4

audio_utils/include/audio_utils/clock.h

index 31bf1f6..3067353 100644 (file)
 #include <sys/time.h>
 #include <time.h>
 
+// These are declared as macros for compatbility with existing uses.
+// TODO Spell out the words in full.
+#define MICROS_PER_SECOND      1000000
+#define MILLIS_PER_SECOND         1000
+#define NANOS_PER_MICROSECOND     1000
+#define NANOS_PER_MILLISECOND  1000000
+#define NANOS_PER_SECOND    1000000000
+
 /**
  * \brief Converts time in ns to a time string, with format similar to logcat.
  * \param ns          input time in nanoseconds to convert.