2016-06-08 5 views
-1

"long getUidRxBytes (int uid)"API를 알고 있지만이 인터페이스는 각 프로세스에서 네트워크 속도를 얻을 수 없습니다. prcocess의 속도를 얻을 수있는 간단한 방법을 알고있는 사람이 있습니까?android에서 프로세스의 속도를 얻는 방법

영어가 부족합니다.

+1

는 "프로세스의 속도"에 의해 무엇을 의미합니까 자신의 개발 언어에 그 알고리즘을 구현해야, 그것은 도움이 희망? – JoxTraex

+0

과정의 네트워크 속도 –

답변

0

기본적으로 속도의 측정에는 시간과 양의 두 가지 매개 변수가 필요합니다. 여기서는 바이트/초를 계산한다고 가정하고 매초 전송 된 바이트 수를 측정해야합니다. 거의 시간, 당신은

totalTimeSpent = 0 
bytesSent = 0 
do 
    beforeSendingTime = getCurrentMilisecond 
    send n bytes to desination via network 
    bytesSent = bytesSent + n 
    afterSendingTime = getCurrentMilisecond 
    timeSpent = afterSendingTime - beforeSendingTime 
    totalTimeSpent = totalTimeSpent + timeSpent 
    say: currentSpeed = n/timeSpent 
    say: averageSpeed = bytesSent/totalTimeSpent 
loop until no data remaining to send 

과 같은 알고리즘이 필요합니다 당신이

+0

무엇이든지, 정말 고마워요. –

관련 문제