| 62 | reset(); |
| 63 | |
| 64 | function reset () { |
| 65 | var time = null; |
| 66 | var bytes = 0; |
| 67 | b.pipeline.get('record').on('end', function () { |
| 68 | time = Date.now(); |
| 69 | }); |
| 70 | |
| 71 | b.pipeline.get('wrap').push(through(write, end)); |
| 72 | function write (buf, enc, next) { |
| 73 | bytes += buf.length; |
| 74 | this.push(buf); |
| 75 | next(); |
| 76 | } |
| 77 | function end () { |
| 78 | var delta = Date.now() - time; |
| 79 | b.emit('time', delta); |
| 80 | b.emit('bytes', bytes); |
| 81 | b.emit('log', bytes + ' bytes written (' |
| 82 | + (delta / 1000).toFixed(2) + ' seconds)' |
| 83 | ); |
| 84 | this.push(null); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | var fwatchers = {}; |
| 89 | var fwatcherFiles = {}; |