Advertisement
Guest User

Node.js Unpredictable

a guest
Feb 6th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let startTime = process.hrtime();
  2. if (centerPoint.getDistance(Mep.Position.getPosition()) < this.config.hazardObstacleDistance) {
  3.     let target = this._targetQueue.getTargetBack();
  4.     if (target !== null) {
  5.         let line = new Line(Mep.Position.getPosition(), target.getPoint());
  6.         if (line.isIntersectWithPolygon(polygon) === true) {
  7.             // this.emit('pathObstacleDetected', true);
  8.         }
  9.     }
  10. }
  11. let diffTime = process.hrtime(startTime);
  12. console.log('Diff time', diffTime[0] * 1000 * 1000 + diffTime[1] / 1000, 'microseconds');
  13.  
  14.  
  15. /*
  16. Results:
  17.  
  18. Diff time 2935.336 microseconds
  19. Diff time 739.212 microseconds
  20. Diff time 97.603 microseconds
  21. Diff time 96.093 microseconds
  22. Diff time 90.832 microseconds
  23. Diff time 89.426 microseconds
  24. ...
  25. ...
  26. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement