How to use the Timer function from hoek

Find comprehensive JavaScript hoek.Timer code examples handpicked from public code repositorys.

110
111
112
113
114
115
116
117
118
119
    }
});

// Lookup in cache

const timer = new Hoek.Timer();
this._get(id, (err, cached) => {

    if (err) {
        ++this.stats.errors;
fork icon74
star icon0
watch icon3

28
29
30
31
32
33
34
35
36

}, 500);

setInterval(function requestor() {

        var timer = new Hoek.Timer();
        callSecureApi('http://localhost:3080', timer)

}, 500);
fork icon1
star icon2
watch icon2

187
188
189
190
191
192
193
194
195

A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

```javascript

var timerObj = new Hoek.Timer();
console.log("Time is now: " + timerObj.ts)
console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds')
```
fork icon170
star icon1
watch icon33