Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let startTime = process.hrtime();
- if (centerPoint.getDistance(Mep.Position.getPosition()) < this.config.hazardObstacleDistance) {
- let target = this._targetQueue.getTargetBack();
- if (target !== null) {
- let line = new Line(Mep.Position.getPosition(), target.getPoint());
- if (line.isIntersectWithPolygon(polygon) === true) {
- // this.emit('pathObstacleDetected', true);
- }
- }
- }
- let diffTime = process.hrtime(startTime);
- console.log('Diff time', diffTime[0] * 1000 * 1000 + diffTime[1] / 1000, 'microseconds');
- /*
- Results:
- Diff time 2935.336 microseconds
- Diff time 739.212 microseconds
- Diff time 97.603 microseconds
- Diff time 96.093 microseconds
- Diff time 90.832 microseconds
- Diff time 89.426 microseconds
- ...
- ...
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement