fvdm / speedtest Goto Github PK
View Code? Open in Web Editor NEWSimple bandwidth test in browser javascript
License: The Unlicense
Simple bandwidth test in browser javascript
License: The Unlicense
This is great! Just wanted to drop a note that Windows also has a tool for creating bin files from the command line. The Command Prompt must be opened as Administrator, but then you can just do this:
fsutil file createnew 1mb.bin 1000000
fsutil file createnew 5mb.bin 5000000
fsutil file createnew 10mb.bin 10000000
fsutil file createnew 100mb.bin 100000000
fsutil file createnew 1000mb.bin 1000000000
Implement upload logic and UI
Figure out why it only runs smooth on TransIP webhosting
Video: slow upload
Video: smooth upload
You might want to change the 'dd' instructions a bit. If you use sparse files, you can have each file only consume one block of storage on the disk while having a much bigger file. To do this, you write a single block with dd and "seek" to the last block of the file.
For instance:
dd if=/dev/zero of=1mb.bin bs=1024 count=1 seek=$(( 1*(1<<10) - 1))
dd if=/dev/zero of=5mb.bin bs=1024 count=1 seek=$(( 5*(1<<10) - 1))
dd if=/dev/zero of=10mb.bin bs=1024 count=1 seek=$(( 10*(1<<10) - 1))
dd if=/dev/zero of=100mb.bin bs=1024 count=1 seek=$((100*(1<<10) - 1))
$ ls -l *.bin; du -cs *.bin
-rw-rw-r-- 1 dave dave 1048576000 May 3 10:25 1000mb.bin
-rw-rw-r-- 1 dave dave 104857600 May 3 10:15 100mb.bin
-rw-rw-r-- 1 dave dave 10485760 May 3 10:15 10mb.bin
-rw-rw-r-- 1 dave dave 1048576 May 3 10:26 1mb.bin
-rw-rw-r-- 1 dave dave 5242880 May 3 10:15 5mb.bin
4 1000mb.bin
4 100mb.bin
4 10mb.bin
8 1mb.bin
4 5mb.bin
24 total
'du' shows the true on-disk storage size of the files.
Hi,
I've refactored the code, added an upload test and a autonegotiation of the test size.
Are you interested in a Pull Request?
https://github.com/perryflynn/speedtest
Regards
Christian
this line is missing in the second if
res += '.';
if ( ! flo && diff ) {
res += '.';
for ( let i = 0; i < diff; i++ ) {
res += '0';
}
}
if ( flo && diff > 0 ) {
for ( let i = 0; i < diff; i++ ) {
res += '0';
}
}
should be change to
if ( ! flo && diff ) {
res += '.';
for ( let i = 0; i < diff; i++ ) {
res += '0';
}
}
if ( flo && diff > 0 ) {
res += '.';
for ( let i = 0; i < diff; i++ ) {
res += '0';
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.