0
BB 프로그래밍에서 HTTP 처리량과 HTTP 대기 시간을 알아보십시오.BlackBerry에서 HTTP 처리량을 캡처하는 방법은 무엇입니까?
BB 프로그래밍에서 HTTP 처리량과 HTTP 대기 시간을 알아보십시오.BlackBerry에서 HTTP 처리량을 캡처하는 방법은 무엇입니까?
System.currentTimeMillis()
을 사용하면 코드의 여러 지점에서 타임 스탬프를 얻은 다음 해당 값을 사용하여 타이밍을 계산할 수 있습니다. 예 :
long start = System.currentTimeMillis();
HttpConnection connection = (HttpConnection) Connector.open(url);
long opened = System.currentTimeMillis();
String body = new String(IOUtilities.streamToBytes(connection.openInputStream()));
long done = System.currentTimeMillis();
long bytes = body.length();
float durationSeconds = (float)(done - opened)/1000.0f;
float bytesPerSecond = bytes/durationSeconds;
System.out.println("Latency: " + (opened - start) + " ms");
System.out.println("Bandwidth: " + bytesPerSecond + " bytes per second");
질문에 의미가 없습니다. –