mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/SSignalKit git-subtree-mainline: 4459dc5b47e7db4ea1adb3a43a4324d1c2f9feab git-subtree-split: 359b2ee7c9f20f99f221f78e307369ef5ad0ece2
51 lines
863 B
Objective-C
51 lines
863 B
Objective-C
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
|
#import <UIKit/UIKit.h>
|
|
#else
|
|
#import <Foundation/Foundation.h>
|
|
#endif
|
|
#import <XCTest/XCTest.h>
|
|
|
|
@import SSignalKit;
|
|
|
|
@interface SSignalPerformanceTests : XCTestCase
|
|
|
|
@end
|
|
|
|
@implementation SSignalPerformanceTests
|
|
|
|
- (void)setUp
|
|
{
|
|
[super setUp];
|
|
}
|
|
|
|
- (void)tearDown
|
|
{
|
|
[super tearDown];
|
|
}
|
|
|
|
- (void)testMap
|
|
{
|
|
[self measureBlock:^
|
|
{
|
|
SSignal *signal = [[[SSignal alloc] initWithGenerator:^id<SDisposable>(SSubscriber *subscriber)
|
|
{
|
|
[subscriber putNext:@1];
|
|
[subscriber putCompletion];
|
|
return nil;
|
|
}] map:^id (id value)
|
|
{
|
|
return value;
|
|
}];
|
|
|
|
for (int i = 0; i < 100000; i++)
|
|
{
|
|
[signal startWithNext:^(__unused id next)
|
|
{
|
|
|
|
}];
|
|
}
|
|
}];
|
|
}
|
|
|
|
@end
|