Skip to content

Commit

Permalink
add type hints and release 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Ning committed Jul 3, 2012
1 parent 8b92bbc commit 4490a36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,7 +5,7 @@ Timing is a simple library to log call time using perf4j.
## Usage

```
[timing "0.1.0"]
[timing "0.1.1"]
```

Just wrap forms you want to calculate call time:
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject timing "0.1.0"
(defproject timing "0.1.1"
:description "A simple timing library for clojure"
:url "http://github.com/sunng87/timing"
:license {:name "Eclipse Public License"
Expand Down
8 changes: 4 additions & 4 deletions src/timing/core.clj
Expand Up @@ -10,7 +10,7 @@
(eval
`(reify LoggingStopWatchFactory
(get-stop-watch [this# tag#]
(org.perf4j.slf4j.Slf4JStopWatch. tag#))))
(org.perf4j.slf4j.Slf4JStopWatch. ^String tag#))))
(catch ClassNotFoundException e nil)))

(defn try-log4j []
Expand All @@ -19,13 +19,13 @@
(eval
`(reify LoggingStopWatchFactory
(get-stop-watch [this# tag#]
(org.perf4j.log4j.Log4JStopWatch. tag#))))
(org.perf4j.log4j.Log4JStopWatch. ^String tag#))))
(catch ClassNotFoundException e nil)))

(defn failback []
(reify LoggingStopWatchFactory
(get-stop-watch [this tag]
(LoggingStopWatch. tag))))
(LoggingStopWatch. ^String tag))))

(def preferred-factory
(or
Expand All @@ -38,7 +38,7 @@
[tag & forms]
`(let [watch# (get-stop-watch preferred-factory (str ~tag))
result# (do ~@forms)]
(.stop watch#)
(.stop ^LoggingStopWatch watch#)
result#))

(defn wrap-timed
Expand Down

0 comments on commit 4490a36

Please sign in to comment.