Created
March 28, 2013 19:55
-
-
Save biasedbit/5266277 to your computer and use it in GitHub Desktop.
BBHTTP transfer rate proposal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct BBTransferRate { | |
unsigned long bytesPerSecond; | |
NSTimeInterval duration; | |
}; | |
typedef struct BBTransferRate BBTransferRate; | |
BBTransferRate BBTransferRateMake(unsigned long bytesPerSecond, NSTimeInterval duration) | |
{ | |
BBTransferRate threshold; | |
threshold.bytesPerSecond = bytesPerSecond; | |
threshold.duration = duration; | |
return threshold; | |
} | |
NSString* NSStringFromBBTransferRate(BBTransferRate transferRate) | |
{ | |
return [NSString stringWithFormat:@"%lu/s for %.0f seconds", transferRate.bytesPerSecond, transferRate.duration]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment