https://github.com/coryrylan/core-speed-test
Small experimental speed test tool using JavaScript
https://github.com/coryrylan/core-speed-test
Last synced: over 1 year ago
JSON representation
Small experimental speed test tool using JavaScript
- Host: GitHub
- URL: https://github.com/coryrylan/core-speed-test
- Owner: coryrylan
- Created: 2013-06-11T02:48:00.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-12-05T17:38:19.000Z (over 11 years ago)
- Last Synced: 2025-01-22T00:46:24.968Z (over 1 year ago)
- Language: CSS
- Homepage: http://splintercode.github.io/core-speed-test/
- Size: 676 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SpeedTest
splintercode.github.io/core-speed-test/
Small experimental speed test tool using JavaScript
This is a small side project I am working on. It is a speed test tool to test my server response on any signal/device.
I would like to experiment with how to get the most accurate result possible using only JavaScript.
There are many factors that contribute to connection speed. This should not be used to decide critical
application decisions. Also to note this gives a estimate speed based on the connection to server it is hosted on. Depending on
where the code is hosted will effect the results.
To more accurately test speeds two files are downloaded.
First a very small gif less than 35 bytes to test latency times.
The second a 50kb jpg to test average download speed.
// Core Speed Test must be run at document load or when new test data is desired.
coreSpeedTest.test();
// Accepts callback for on test completion.
coreSpeedTest.test(function () {
doStuffWhenDone();
});
// Get values from most recent test.
coreSpeedTest.latencyTime(); // Get startup latency time
coreSpeedTest.speedBps(); // Get Bps download speed
coreSpeedTest.speedKbps(); // Get Kbps download speed
coreSpeedTest.speedMbps(); // Get Mbps download speed
coreSpeedTest.settings.latencyImage("imageSmall.gif"); // Set custom file to test latency speed ( default 35 bytes img )
coreSpeedTest.settings.downloadImage("imageLarge.jpg"); // Set custom file to test download speed ( default 50kb img )
Please feel free to offer suggestions or contribute.
License
This code is free to use under the MIT License.
Read more at MIT License