2018-07-17 21:12:12 +00:00
|
|
|
import { expect, tap } from '@pushrocks/tapbundle';
|
|
|
|
import * as smartdelay from '@pushrocks/smartdelay';
|
|
|
|
import early = require('../ts/index');
|
2016-05-20 17:06:25 +00:00
|
|
|
|
2017-03-26 20:01:33 +00:00
|
|
|
tap.test('.start()', async () => {
|
2018-07-17 21:12:12 +00:00
|
|
|
early.start('early');
|
|
|
|
await smartdelay.delayFor(2000);
|
|
|
|
});
|
2017-04-23 16:46:13 +00:00
|
|
|
|
2017-03-26 20:01:33 +00:00
|
|
|
tap.test('.stop()', async () => {
|
2018-07-17 21:12:12 +00:00
|
|
|
await early.stop();
|
|
|
|
});
|
2017-04-23 16:46:13 +00:00
|
|
|
|
|
|
|
tap.test('hrTime Measurement', async () => {
|
2018-07-17 21:12:12 +00:00
|
|
|
let earlyHr = new early.HrtMeasurement();
|
|
|
|
earlyHr.start();
|
|
|
|
await smartdelay.delayFor(1000);
|
|
|
|
let measuredTime = earlyHr.stop();
|
|
|
|
console.log(measuredTime);
|
|
|
|
return expect(measuredTime.milliSeconds).to.be.greaterThan(999);
|
|
|
|
});
|
2017-04-23 16:46:13 +00:00
|
|
|
|
2018-07-17 21:12:12 +00:00
|
|
|
tap.start();
|