-
Notifications
You must be signed in to change notification settings - Fork 262
Expand file tree
/
Copy pathpull.js
More file actions
31 lines (27 loc) · 879 Bytes
/
pull.js
File metadata and controls
31 lines (27 loc) · 879 Bytes
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
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const Bench = require('bench');
const {spawn} = require('child_process');
const Adb = require('../..');
const deviceId = process.env.DEVICE_ID;
module.exports = {
compareCount: 3,
compare: {
"pull /dev/graphics/fb0 using ADB CLI"(done) {
const proc = spawn('adb',
['-s', deviceId, 'pull', '/dev/graphics/fb0', '/dev/null']);
return proc.stdout.on('end', done);
},
"pull /dev/graphics/fb0 using client.pull()"(done) {
const client = Adb.createClient();
return client.pull(deviceId, '/dev/graphics/fb0', function(err, stream) {
stream.resume();
return stream.on('end', done);
});
}
}
};
Bench.runMain();