Guest User

Untitled

a guest
Oct 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. const start = new Date();
  2.  
  3. const totalIterations = 30,
  4. records = xelib.GetRecords(0, 'WEAP,ARMO,MISC'),
  5. numCalls = totalIterations * records.length;
  6.  
  7. console.log(`Calling xelib.FullName ${numCalls} times...`);
  8. for (let i = 0; i < totalIterations; i++) {
  9. for (let rec of records) {
  10. xelib.FullName(rec);
  11. }
  12. }
  13.  
  14. const duration = new Date() - start;
  15. console.log(`Completed in ${duration}ms`);
  16. const timePerCall = (duration / numCalls) * 1000;
  17. console.log(`${timePerCall.toFixed(1)}μs per call`);
Add Comment
Please, Sign In to add comment