简体   繁体   English

移动设备上的图像处理速度

[英]Image processing speed on mobile devices

Good evening. 晚上好。

How can I measure the speed of image processing on android and ios devices ? 如何测量android和ios设备上图像处理的速度? Show me, please, what way should I seek ? 请告诉我,我应该寻找什么方式? I found that OpenCl can helps me, but also I saw that Android has no plans to support OpenCL. 我发现OpenCl可以帮助我,但我也看到Android没有计划支持OpenCL。 Thanks. 谢谢。

On iOS use NSDate : 在iOS上使用NSDate

NSDate *startDate = [NSDate date];
// image processing code
NSLog(@"cell time: %0.3f", -[startDate timeIntervalSinceNow]);

For finer grained timing: 对于更细粒度的计时:

#import <mach/mach_time.h>
uint64_t time_a = mach_absolute_time();
// image processing code
uint64_t machTime = mach_absolute_time()-time_a;

double timeScaleSeconds = 0.0;
double timeScaleMicroSeconds = 0.0;
mach_timebase_info_data_t timebaseInfo;
if (mach_timebase_info(&timebaseInfo) == KERN_SUCCESS) {
    timeScaleMicroSeconds = ((double) timebaseInfo.numer / (double) timebaseInfo.denom) / 1000;
    timeScaleSeconds = timeScaleMicroSeconds / 1000000;
}
double seconds = timeScaleSeconds*machTime;
NSLog(@"%0.6f sec", seconds);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM