업로드 중에 채널이 uploadedBytes
인 것으로 가정합니다.
-> 업로드 시작을 알면이 스크립트를 호출하십시오.
var timecontroller = setInterval(function(){
timeElapsed = (new Date()) - timeStarted; //assumng that timeStarted is a Data Object
uploadSpeed = uploadedBytes/(timeElapsed/1000); //upload speed in second
callback((totalBytes - uploadedBytes)/uploadSpeed); //callback is the funciont that show the time to usder the only argoment is the second remaining to the end
},1000)
-> 파일이 완전히 명확 간격 timecontroller
업로드 할 때 :
clearInterval(timecontroller)
에주의 : timeStarted
는 데이터 개체이어야합니다.
말해 주면. @Stefano Sanfilippo에 thx - 나는 그의 대본을 사용합니다.
음 .. 업로드하는 데 걸리는 시간은 속도에 따라 다르기 때문에 필요합니다. 당신은 당신이 가진 변수로부터 그것을 계산할 수 없습니다. – putvande
네트워크 속도에 따라 다릅니다. "2MB 줄 *"에 기초한 "* x 분"이라는 메시지를 말한 경우 – MackieeE
입력하면 평균 업로드 속도를 사용하여 근사치를 제공 할 수 있습니다. –