Skip to content

Commit

Permalink
Improve Performance API usage in server_selector.js
Browse files Browse the repository at this point in the history
  • Loading branch information
adolfintel committed May 7, 2019
1 parent db6a3ca commit 9883b00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Frontend/server_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function ping(url, result) {
var instspd = new Date().getTime() - t; //rough timing estimate
try {
//try to get more accurate timing using performance API
var p = performance.getEntries();
p = p[p.length - 1];
var p = performance.getEntriesByName(url);
p=p[p.length-1];
var d = p.responseStart - p.requestStart;
if (d <= 0) d = p.duration;
if (d > 0 && d < instspd) instspd = d;
Expand Down
2 changes: 1 addition & 1 deletion Frontend/server_selector.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9883b00

Please sign in to comment.