Skip to content

Commit

Permalink
Updating README for prettier display with Github Flavored Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
avk committed May 13, 2011
1 parent fabc9d8 commit 9dba5ae
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Expand Up @@ -5,25 +5,37 @@ jQuery Chrono provides syntactic sugar around JavaScript's native
`setTimeout` and `setInterval` functions.

To execute some code in 5 minutes, instead of writing:

```js
setTimeout(function() { ... }, 300000); // how many zeros is that?
```

or the slightly more readable:

```js
setTimeout(function() { ... }, 5 * 60 * 1000); // 5... (multiplies in head) min
```

now you can just write:

```js
$.after(5, "minutes", function() { ... }); // :)
````

`setTimeout` becomes `$.after` and `setInterval` becomes `$.every`.

***

Usage
-----

These are all valid calls:

```js
$.after(100, function() { ... }); // 100 milliseconds
$.after("9.7", function() { ... }); // 9.7 milliseconds
$.after("50sec", function() { ... }); // 50 seconds
$.after(7, "mins", function() { ... }); // 7 minutes
$.after("33", "hours", function() { ... }); // 33 hours
```

`$.every`, for creating intervals, has the same exact syntax as `$.after`.

Expand All @@ -41,8 +53,6 @@ Valid time units include:

along with all their common abbreviations and pluralizations.

***

Meta
----

Expand Down

0 comments on commit 9dba5ae

Please sign in to comment.