Browse files

add type hints and release 0.1.1

  • Loading branch information...
1 parent 8b92bbc commit 4490a36a34bedede2da8727f0eac213bef142887 Sun Ning committed Jul 3, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 README.md
  2. +1 −1 project.clj
  3. +4 −4 src/timing/core.clj
View
2 README.md
@@ -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:
View
2 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"
View
8 src/timing/core.clj
@@ -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 []
@@ -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
@@ -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

0 comments on commit 4490a36

Please sign in to comment.