117 | random number: {{randomNumber}}
118 |
119 | ```
120 |
121 | ```javascript
122 | Template.foo.helpers({
123 |
124 | // returns a random number between 0 and 10, every second
125 | randomNumber : function() {
126 | Chronos.update();
127 | return Math.round( Math.random() * 10 );
128 | }
129 | });
130 | ```
131 |
132 | Example with autorun:
133 |
134 | ```javascript
135 | // this will create counter and logs it every second
136 | var count = 0;
137 |
138 | Tracker.autorun(function() {
139 | Chronos.update();
140 | console.log(count);
141 | count++;
142 | });
143 | ```
144 |
145 | _Note: this uses a `Chronos.Timer` under the hood. This timer is started automatically when you call `.update`_
146 |
147 |
148 |
149 | ## Chronos.Timer()
150 | usage:
151 |
152 | ```javascript
153 | // create new timer. defaults to an interval of 1000ms
154 | var timer = new Chronos.Timer(interval);
155 | ```
156 |
157 | The timer exposes the `time` property, which is a [ReactiveVar](http://docs.meteor.com/#/full/reactivevar) and it holds the current time.
158 | Getting the time value is reactive so it will trigger re-runs whenever the timer produces an update.
159 |
160 | ```javascript
161 | timer.time.get();
162 | ```
163 |
164 | Example template + helper:
165 |
166 | ```html
167 |