-
Notifications
You must be signed in to change notification settings - Fork 17
/
speedTest.js
68 lines (58 loc) · 1.52 KB
/
speedTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
'use strict';
var fetchSingleDate = require('./index.js').fetchSingleDate;
var fetchDateRange = require('./index.js').fetchDateRange;
var logger = function(type, preTest){
if (type === 'single') {
console.log('Single Date Data: ', new Date() - preTest + 'ms');
} else if (type === '5 days') {
console.log('5 Days Data: ', new Date() - preTest + 'ms');
} else if (type === '10 days') {
console.log('10 Days Data: ', new Date() - preTest + 'ms');
} else if (type === '20 days') {
console.log('20 Days Data: ', new Date() - preTest + 'ms');
}
};
var testSingleDay = function(){
var preTest = new Date();
fetchSingleDate('azey47', '2014-09-29', 'all', function(data){
logger('single', preTest);
});
};
var test5Days = function(){
var preTest = new Date();
fetchDateRange('azey47', '2014-09-29', '2014-10-03', 'all', function(data){
logger('5 days', preTest);
});
};
var test10Days = function(){
var preTest = new Date();
fetchDateRange('azey47', '2014-09-29', '2014-10-08', 'all', function(data){
logger('10 days', preTest);
});
};
var test20Days = function(){
var preTest = new Date();
fetchDateRange('azey47', '2014-09-29', '2014-10-18', 'all', function(data){
logger('20 days', preTest);
});
};
testSingleDay();
testSingleDay();
testSingleDay();
testSingleDay();
testSingleDay();
test5Days();
test5Days();
test5Days();
test5Days();
test5Days();
test10Days();
test10Days();
test10Days();
test10Days();
test10Days();
test20Days();
test20Days();
test20Days();
test20Days();
test20Days();