Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log('Now Starting');
- var native = require('./build/Release/hello.node');
- console.log(native);
- var comp_files = 0;
- var files = ['YourB.mp3','Akon.mp3'];
- function completed(){
- comp_files++;
- if( comp_files === files.length){
- var sec = new Date().getTime() - start;
- console.log("Finished "+files.length+" files in "+sec+" milliseconds ");
- }
- }
- var start = new Date().getTime();
- for(var i = 0; i < files.length;i++){
- (function(){
- var packets = 0;
- new native.test({
- async:true,
- file:files[i],
- type:"scan"},
- {
- Err:function(err){ console.log(err) },
- End:function(ArrayBuffer){
- completed();
- // console.log("Got Last Data Packet");
- },
- Id3:function(v2){
- console.dir(v2);
- },
- Data:function(ArrayBuffer){
- // console.log("Me gusta DataPacket");
- if(ArrayBuffer.length){
- packets++;
- if(packets == 1)
- console.log(ArrayBuffer[ArrayBuffer.length-1]);
- }
- }
- }).read();
- })();
- }
- setTimeout(function(){
- console.log("Its stable");
- },500);
- setTimeout(function(){
- console.log("Its asynchronous if u can see this before file ends")
- },1000);
- setTimeout(function(){
- console.log("Now lets see how much it memory leaked , if any");
- },10000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement