Skip to content

Commit

Permalink
update README for 0.1.2 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Ning committed Jul 5, 2012
1 parent df30612 commit d7cd3fa
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Expand Up @@ -8,6 +8,8 @@ Timing is a simple library to log call time using perf4j.
[timing "0.1.2"] [timing "0.1.2"]
``` ```


### timed

Just wrap forms you want to calculate call time: Just wrap forms you want to calculate call time:


```clojure ```clojure
Expand All @@ -23,8 +25,31 @@ Timing will select a logging provider automatically by looking up your
classpath (slf4j, log4j and stderr). Timing doesn't depend on any classpath (slf4j, log4j and stderr). Timing doesn't depend on any
logging provider at compile time. logging provider at compile time.


### timed-fn

Convert a predefined function to a timed one.

```clojure
(defn count-how-many-people-on-the-earth [req]
)

(defroute my-website
(GET "/count" (timed-fn count-how-many-people-on-the-earth)))
```

### defn-timed

Define a function who is born to be timed.

```clojure
(defn-timed count-how-many-ants-on-the-earth [req]
)
```

### wrap-timed

There's also a built-in ring middleware to log call time for every There's also a built-in ring middleware to log call time for every
request. request. `wrap-timed` uses uri as timing tags.


```clojure ```clojure
(wrap-timed handler) (wrap-timed handler)
Expand Down

0 comments on commit d7cd3fa

Please sign in to comment.