Skip to content

Commit

Permalink
Introduce (common/linear-time)
Browse files Browse the repository at this point in the history
  • Loading branch information
aphyr committed Jun 17, 2012
1 parent 12d6b56 commit 896d0b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/riemann/common.clj
Expand Up @@ -41,6 +41,13 @@
[]
(/ (System/currentTimeMillis) 1000))

(defn linear-time
"A current time on a linear scale with no fixed epoch; counts in seconds.
Unlike unix-time, which can pause, skip, or flow backwards, advances
consistently at (close) to wall clock time."
[]
(/ (System/nanoTime) 1000000000))

(defn time-at
"Returns the Date of a unix epoch time."
[unix-time]
Expand Down

0 comments on commit 896d0b5

Please sign in to comment.