MugunthKumar/MKNetworkKit — Issue #31: To Big read time from memory cache
Author: allright
Created: 2012-01-13 08:23:10+00:00
State: open

4 ms, reading from memory.
For smooth scrolling using table view need additional cache layer in UI.

NSURL* originalURL = [NSURL URLWithString:((Asset*)assetNode).thumbnail_url];

[networkEngine imageAtURL:originalURL
onCompletion:^(UIImage *fetchedImage, NSURL *fetchedURL, BOOL isInCache) {
if(originalURL == fetchedURL)
[button setBackgroundImage:fetchedImage forState:UIControlStateNormal];
}];

// [button setBackgroundImage:[assetNode thumbnail] forState:UIControlStateNormal];

CFAbsoluteTime stopTime = CFAbsoluteTimeGetCurrent();
CFAbsoluteTime delta = startTime - stopTime;
NSLog(@"DELTA = %f",delta);