HDInternetSpeedMeasuring.h 1 KB
Newer Older
Han Ruisong's avatar
Han Ruisong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//
//  InternetSpeedMeasuring.h
//  HDBaseUtils
//
//  Created by zwl on 2020/5/11.
//  Copyright © 2020 zwl. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class HDInternetSpeedMeasuring;

@protocol HDInternetSpeedMeasuringDelegate <NSObject>

@optional

Hanruisong's avatar
Hanruisong committed
17
18
19
20
21
/** 网络测速回调,当error存在时,bytes为-1
 @param speedMeasuring 自身对象
 @param bytes 字节数
 @param error 错误信息
 */
Han Ruisong's avatar
Han Ruisong committed
22
23
24
25
26
27
-(void)HD_InternetSpeedMeasuring:(HDInternetSpeedMeasuring *)speedMeasuring Bytes:(long long)bytes Error:(NSError *)error;

@end

@interface HDInternetSpeedMeasuring : NSObject

Hanruisong's avatar
Hanruisong committed
28
29
30
/**
 *  @brief 测速间隔单位秒,调用start前设置有效。默认3秒
 */
Han Ruisong's avatar
Han Ruisong committed
31
32
@property(nonatomic,assign)CGFloat spaceTime;

Hanruisong's avatar
Hanruisong committed
33
34
35
/**
 *  @brief 代理
 */
Han Ruisong's avatar
Han Ruisong committed
36
37
@property(nonatomic,weak) id <HDInternetSpeedMeasuringDelegate> delegate;

Hanruisong's avatar
Hanruisong committed
38
39
40
41
42
/*!
 * @method
 * @abstract 开始测速
 * @discussion 开始测速
 */
Han Ruisong's avatar
Han Ruisong committed
43
44
-(void)start;

Hanruisong's avatar
Hanruisong committed
45
46
47
48
49
/*!
 * @method
 * @abstract 停止测速
 * @discussion 停止测速
 */
Han Ruisong's avatar
Han Ruisong committed
50
51
52
-(void)stop;

@end