10000 Example use as the documentation is not good: · Issue #31 · branchard/fast-speedtest-api · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example use as the documentation is not good: #31

Open
aishtiaq7 opened this issue May 7, 2021 · 2 comments
Open

Example use as the documentation is not good: #31

aishtiaq7 opened this issue May 7, 2021 · 2 comments

Comments

@aishtiaq7
Copy link
aishtiaq7 commented May 7, 2021

`

speedTestMbps().then(res=> console.log(res)); //Test net speed.

const FastSpeedtest = require
8000
("fast-speedtest-api");
//Returns float for Mbps
//'timeout' miliseconds tests for how long the data download speed was tested.
async function speedTestMbps(msg) {
let speedtest = new FastSpeedtest({
	token: "YXNkZmFzZGxmbnNkYWZoYXNkZmhrYWxm", // required
	verbose: false, // default: false
	timeout: 10000, // default: 5000
	https: true, // default: true
	urlCount: 5, // default: 5
	bufferSize: 8, // default: 8 
	unit: FastSpeedtest.UNITS.Mbps // default: Bps
});

try {
	const s = await speedtest.getSpeed();
	console.log(`Speed: ${s} Mbps`);
	return s;
} catch (e) {
	console.error(e.message);
}

}

`

@yogesh021
Copy link

@aishtiaq7 how long the token remains valid ?

@aishtiaq7
Copy link
Author

speedtest

Not sure about that. Might have to refer to its documentation for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0