代码之家  ›  专栏  ›  技术社区  ›  AYMADA

iOS NSUrlConnection检查上传速度

  •  1
  • AYMADA  · 技术社区  · 11 年前

    我将文件上传到HTTP服务器。我知道我可以用方法上传程序

    - (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
    

    但是有什么方法可以提高上传速度吗?

    1 回复  |  直到 11 年前
        1
  •  3
  •   Community CDub    7 年前

    question 我得到了这个答案,虽然它是为了下载速度,但你也可以通过这个来计算上传速度。测量上传的字节数差和调用代理之间的时间差,然后可以计算每秒字节数(或其他时间单位)的持续速度。

    another answer 这可以帮助你。 One more reference (从评论中添加)。

    希望这有帮助..:)