队
当我登录并使用申请时,我必须找到恒定的带宽,直到我没有退出...
我试过这段代码,但它只给出了一个时间速度,我想要对带宽进行恒速跟踪..
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.downloadSpeedMeasure.active = YES;
[operation setUploadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead)
{
}];
// to avoid a retain cycle one has to pass a weak reference to operation into the progress block.
[operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
float progress = ((float)totalBytesRead) / totalBytesExpectedToRead;
NSLog(@"%f",progress);
double speedInBytesPerSecond = operation.downloadSpeedMeasure.speed;
NSString *humanReadableSpeed = operation.downloadSpeedMeasure.humanReadableSpeed;
double humanReadableSpeed1 = operation.downloadSpeedMeasure.speed;
// NSTimeInterval remainingTimeInSeconds = [operation.downloadSpeedMeasure remainingTimeOfTotalSize:totalBytesExpectedToRead numberOfCompletedBytes:totalBytesRead];
// NSString *humanReadableRemaingTime = [operation.downloadSpeedMeasure humanReadableRemainingTimeOfTotalSize:totalBytesExpectedToRead numberOfCompletedBytes:totalBytesRead];
NSLog(@"humanReadableSpeed : %@",humanReadableSpeed);
NSLog(@"humanReadableSpeed : %f",humanReadableSpeed1);
//NSLog(@"speedInBytesPerSecond : %f",speedInBytesPerSecond);
}];
[operation start];
任何人都可以帮我找到如何使用任何第三方库,功能,演示获得恒定带宽????
提前完成了......