NSTimer的精确度
1、iOS中一般UI上面常用两种定时器 NSTimer和CADisplayLink,那么它们分别的精确度是如何呢?
CADisplayLink 是用于帧刷新定时器,也就是和界面的刷新率保持一致,理想情况下FPS为60,并尽力保持60
NSTimer是否可以比CADisplayLink更加精确呢,最精确能下面的间隔是多少呢?NSTimer和CADisplayLink都作为一种事件加入到NSRunloop的事件源中,
NSRunloop不断循环,判断是否应该触发这一类事件,如下面所示,NSRunloop包涵下面这些不同的事件:
typedef CF_OPTIONS(CFOptionFlags, CFRunLoopActivity) {
kCFRunLoopEntry = (1UL << 0), // 即将进入Loop
kCFRunLoopBeforeTimers = (1UL << 1), // 即将处理 Timer
kCFRunLoopBeforeSources = (1UL << 2), // 即将处理 Source
kCFRunLoopBeforeWaiting = (1UL << 5), // 即将进入休眠
kCFRunLoopAfterWaiting = (1UL << 6), // 刚从休眠中唤醒
kCFRunLoopExit = (1UL << 7), // 即将退出Loop
};
可以看出,如果想让CADisplayLink正常工作,NSRunloop至少每秒循环60次,也就是至多17ms,那么NSRunloop每秒最多循环多少次呢?
2、NSRunloop每秒循环多少次
通过注册一个观察者到主线程中,观察每一种事件执行的log,来看看NSRunloop的执行情况
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch. CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(NULL, (kCFRunLoopAllActivities), YES, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity)
{
static unsigned long count = 0; if(activity & kCFRunLoopEntry)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopEntry");
}
else if(activity & kCFRunLoopBeforeTimers)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopBeforeTimers");
}
else if(activity & kCFRunLoopBeforeSources)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopBeforeSources");
}
else if(activity & kCFRunLoopBeforeWaiting)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopBeforeWaiting");
}
else if(activity & kCFRunLoopAfterWaiting)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopAfterWaiting");
}
else if(activity & kCFRunLoopExit)
{
NSLog(@"activity %lu: %@", ++count, @"kCFRunLoopExit");
}
});
CFRunLoopAddObserver(CFRunLoopGetMain(), observer, kCFRunLoopCommonModes); return YES;
}
这里打印出每一类的事件,同时需要加上两类定时器到主线程中
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. NSTimer *timer = [NSTimer timerWithTimeInterval:0.001 repeats:YES block:^(NSTimer * _Nonnull timer) { static int timerCount = 0;
//do nothing
NSLog(@"timer do nothing, timerCount = %d", timerCount++);
}]; [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update:)];
[link addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; } - (void)update:(id)sender
{
static int linkCount = 0;
NSLog(@"link do nothing, linkCount = %d", linkCount++);
}
可以观察出每一类事件执行的情况,测试是在iphone5s, ios10.2的系统上
输出:
NSRunloop:
2017-03-18 13:01:54.145100 NSTimerTest[1121:267663] activity 20: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.148893 NSTimerTest[1121:267663] activity 24: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.150659 NSTimerTest[1121:267663] activity 28: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.153758 NSTimerTest[1121:267663] activity 32: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.155796 NSTimerTest[1121:267663] activity 36: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.158515 NSTimerTest[1121:267663] activity 40: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.160481 NSTimerTest[1121:267663] activity 44: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.162514 NSTimerTest[1121:267663] activity 48: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.165265 NSTimerTest[1121:267663] activity 52: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.169531 NSTimerTest[1121:267663] activity 56: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.229129 NSTimerTest[1121:267663] activity 74: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.232630 NSTimerTest[1121:267663] activity 78: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.233628 NSTimerTest[1121:267663] activity 82: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.235007 NSTimerTest[1121:267663] activity 86: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.236381 NSTimerTest[1121:267663] activity 90: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.237788 NSTimerTest[1121:267663] activity 94: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.238881 NSTimerTest[1121:267663] activity 98: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.239719 NSTimerTest[1121:267663] activity 102: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.240767 NSTimerTest[1121:267663] activity 106: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.241759 NSTimerTest[1121:267663] activity 110: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.242658 NSTimerTest[1121:267663] activity 114: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.243716 NSTimerTest[1121:267663] activity 118: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.244833 NSTimerTest[1121:267663] activity 122: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.245719 NSTimerTest[1121:267663] activity 126: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.247445 NSTimerTest[1121:267663] activity 130: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.248342 NSTimerTest[1121:267663] activity 134: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.250020 NSTimerTest[1121:267663] activity 138: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.251359 NSTimerTest[1121:267663] activity 142: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.252876 NSTimerTest[1121:267663] activity 146: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.254850 NSTimerTest[1121:267663] activity 150: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.256126 NSTimerTest[1121:267663] activity 154: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.257336 NSTimerTest[1121:267663] activity 158: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.258301 NSTimerTest[1121:267663] activity 162: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.259885 NSTimerTest[1121:267663] activity 166: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.261638 NSTimerTest[1121:267663] activity 170: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.262796 NSTimerTest[1121:267663] activity 174: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.264645 NSTimerTest[1121:267663] activity 178: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.265702 NSTimerTest[1121:267663] activity 182: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.266818 NSTimerTest[1121:267663] activity 186: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.268355 NSTimerTest[1121:267663] activity 190: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.269167 NSTimerTest[1121:267663] activity 194: kCFRunLoopBeforeWaiting
2017-03-18 13:01:54.269909 NSTimerTest[1121:267663] activity 198: kCFRunLoopBeforeWaiting
NSTimer
2017-03-18 13:01:54.127460 NSTimerTest[1121:267663] timer do nothing, timerCount = 0
2017-03-18 13:01:54.135893 NSTimerTest[1121:267663] timer do nothing, timerCount = 1
2017-03-18 13:01:54.140639 NSTimerTest[1121:267663] timer do nothing, timerCount = 2
2017-03-18 13:01:54.142266 NSTimerTest[1121:267663] timer do nothing, timerCount = 3
2017-03-18 13:01:54.143658 NSTimerTest[1121:267663] timer do nothing, timerCount = 4
2017-03-18 13:01:54.147695 NSTimerTest[1121:267663] timer do nothing, timerCount = 5
2017-03-18 13:01:54.151489 NSTimerTest[1121:267663] timer do nothing, timerCount = 6
2017-03-18 13:01:54.154552 NSTimerTest[1121:267663] timer do nothing, timerCount = 7
2017-03-18 13:01:54.156480 NSTimerTest[1121:267663] timer do nothing, timerCount = 8
2017-03-18 13:01:54.159303 NSTimerTest[1121:267663] timer do nothing, timerCount = 9
2017-03-18 13:01:54.161246 NSTimerTest[1121:267663] timer do nothing, timerCount = 10
2017-03-18 13:01:54.163655 NSTimerTest[1121:267663] timer do nothing, timerCount = 11
2017-03-18 13:01:54.170411 NSTimerTest[1121:267663] timer do nothing, timerCount = 12
2017-03-18 13:01:54.226209 NSTimerTest[1121:267663] timer do nothing, timerCount = 13
2017-03-18 13:01:54.228032 NSTimerTest[1121:267663] timer do nothing, timerCount = 14
2017-03-18 13:01:54.231912 NSTimerTest[1121:267663] timer do nothing, timerCount = 15
2017-03-18 13:01:54.234140 NSTimerTest[1121:267663] timer do nothing, timerCount = 16
2017-03-18 13:01:54.235779 NSTimerTest[1121:267663] timer do nothing, timerCount = 17
2017-03-18 13:01:54.236939 NSTimerTest[1121:267663] timer do nothing, timerCount = 18
2017-03-18 13:01:54.238231 NSTimerTest[1121:267663] timer do nothing, timerCount = 19
2017-03-18 13:01:54.239210 NSTimerTest[1121:267663] timer do nothing, timerCount = 20
2017-03-18 13:01:54.240251 NSTimerTest[1121:267663] timer do nothing, timerCount = 21
2017-03-18 13:01:54.241185 NSTimerTest[1121:267663] timer do nothing, timerCount = 22
2017-03-18 13:01:54.242131 NSTimerTest[1121:267663] timer do nothing, timerCount = 23
2017-03-18 13:01:54.243136 NSTimerTest[1121:267663] timer do nothing, timerCount = 24
2017-03-18 13:01:54.244139 NSTimerTest[1121:267663] timer do nothing, timerCount = 25
2017-03-18 13:01:54.245170 NSTimerTest[1121:267663] timer do nothing, timerCount = 26
2017-03-18 13:01:54.246129 NSTimerTest[1121:267663] timer do nothing, timerCount = 27
2017-03-18 13:01:54.248936 NSTimerTest[1121:267663] timer do nothing, timerCount = 28
2017-03-18 13:01:54.250729 NSTimerTest[1121:267663] timer do nothing, timerCount = 29
2017-03-18 13:01:54.252273 NSTimerTest[1121:267663] timer do nothing, timerCount = 30
2017-03-18 13:01:54.253343 NSTimerTest[1121:267663] timer do nothing, timerCount = 31
2017-03-18 13:01:54.255634 NSTimerTest[1121:267663] timer do nothing, timerCount = 32
2017-03-18 13:01:54.256494 NSTimerTest[1121:267663] timer do nothing, timerCount = 33
2017-03-18 13:01:54.257829 NSTimerTest[1121:267663] timer do nothing, timerCount = 34
2017-03-18 13:01:54.259261 NSTimerTest[1121:267663] timer do nothing, timerCount = 35
2017-03-18 13:01:54.260290 NSTimerTest[1121:267663] timer do nothing, timerCount = 36
2017-03-18 13:01:54.262144 NSTimerTest[1121:267663] timer do nothing, timerCount = 37
2017-03-18 13:01:54.263531 NSTimerTest[1121:267663] timer do nothing, timerCount = 38
2017-03-18 13:01:54.266225 NSTimerTest[1121:267663] timer do nothing, timerCount = 39
2017-03-18 13:01:54.267656 NSTimerTest[1121:267663] timer do nothing, timerCount = 40
2017-03-18 13:01:54.268629 NSTimerTest[1121:267663] timer do nothing, timerCount = 41
2017-03-18 13:01:54.269641 NSTimerTest[1121:267663] timer do nothing, timerCount = 42
2017-03-18 13:01:54.271133 NSTimerTest[1121:267663] timer do nothing, timerCount = 43
2017-03-18 13:01:54.272366 NSTimerTest[1121:267663] timer do nothing, timerCount = 44
2017-03-18 13:01:54.273213 NSTimerTest[1121:267663] timer do nothing, timerCount = 45
2017-03-18 13:01:54.274115 NSTimerTest[1121:267663] timer do nothing, timerCount = 46
2017-03-18 13:01:54.275425 NSTimerTest[1121:267663] timer do nothing, timerCount = 47
2017-03-18 13:01:54.276400 NSTimerTest[1121:267663] timer do nothing, timerCount = 48
2017-03-18 13:01:54.278951 NSTimerTest[1121:267663] timer do nothing, timerCount = 49
2017-03-18 13:01:54.281740 NSTimerTest[1121:267663] timer do nothing, timerCount = 50
2017-03-18 13:01:54.283120 NSTimerTest[1121:267663] timer do nothing, timerCount = 51
2017-03-18 13:01:54.284362 NSTimerTest[1121:267663] timer do nothing, timerCount = 52
CADisplayLink
2017-03-18 13:01:54.138378 NSTimerTest[1121:267663] link do nothing, linkCount = 0
2017-03-18 13:01:54.149657 NSTimerTest[1121:267663] link do nothing, linkCount = 1
2017-03-18 13:01:54.166121 NSTimerTest[1121:267663] link do nothing, linkCount = 2
2017-03-18 13:01:54.225401 NSTimerTest[1121:267663] link do nothing, linkCount = 3
2017-03-18 13:01:54.233023 NSTimerTest[1121:267663] link do nothing, linkCount = 4
2017-03-18 13:01:54.247794 NSTimerTest[1121:267663] link do nothing, linkCount = 5
2017-03-18 13:01:54.265119 NSTimerTest[1121:267663] link do nothing, linkCount = 6
2017-03-18 13:01:54.280689 NSTimerTest[1121:267663] link do nothing, linkCount = 7
2017-03-18 13:01:54.298406 NSTimerTest[1121:267663] link do nothing, linkCount = 8
2017-03-18 13:01:54.315036 NSTimerTest[1121:267663] link do nothing, linkCount = 9
2017-03-18 13:01:54.331416 NSTimerTest[1121:267663] link do nothing, linkCount = 10
2017-03-18 13:01:54.346888 NSTimerTest[1121:267663] link do nothing, linkCount = 11
2017-03-18 13:01:54.363696 NSTimerTest[1121:267663] link do nothing, linkCount = 12
2017-03-18 13:01:54.380435 NSTimerTest[1121:267663] link do nothing, linkCount = 13
2017-03-18 13:01:54.398125 NSTimerTest[1121:267663] link do nothing, linkCount = 14
2017-03-18 13:01:54.414091 NSTimerTest[1121:267663] link do nothing, linkCount = 15
2017-03-18 13:01:54.430187 NSTimerTest[1121:267663] link do nothing, linkCount = 16
2017-03-18 13:01:54.447019 NSTimerTest[1121:267663] link do nothing, linkCount = 17
2017-03-18 13:01:54.463854 NSTimerTest[1121:267663] link do nothing, linkCount = 18
2017-03-18 13:01:54.480343 NSTimerTest[1121:267663] link do nothing, linkCount = 19
2017-03-18 13:01:54.513566 NSTimerTest[1121:267663] link do nothing, linkCount = 21
2017-03-18 13:01:54.530110 NSTimerTest[1121:267663] link do nothing, linkCount = 22
2017-03-18 13:01:54.547502 NSTimerTest[1121:267663] link do nothing, linkCount = 23
2017-03-18 13:01:54.565346 NSTimerTest[1121:267663] link do nothing, linkCount = 24
2017-03-18 13:01:54.580107 NSTimerTest[1121:267663] link do nothing, linkCount = 25
2017-03-18 13:01:54.598014 NSTimerTest[1121:267663] link do nothing, linkCount = 26
2017-03-18 13:01:54.629988 NSTimerTest[1121:267663] link do nothing, linkCount = 28
2017-03-18 13:01:54.646657 NSTimerTest[1121:267663] link do nothing, linkCount = 29
2017-03-18 13:01:54.663800 NSTimerTest[1121:267663] link do nothing, linkCount = 30
2017-03-18 13:01:54.680001 NSTimerTest[1121:267663] link do nothing, linkCount = 31
2017-03-18 13:01:54.697108 NSTimerTest[1121:267663] link do nothing, linkCount = 32
2017-03-18 13:01:54.713726 NSTimerTest[1121:267663] link do nothing, linkCount = 33
2017-03-18 13:01:54.729956 NSTimerTest[1121:267663] link do nothing, linkCount = 34
2017-03-18 13:01:54.746658 NSTimerTest[1121:267663] link do nothing, linkCount = 35
2017-03-18 13:01:54.763778 NSTimerTest[1121:267663] link do nothing, linkCount = 36
2017-03-18 13:01:54.779953 NSTimerTest[1121:267663] link do nothing, linkCount = 37
2017-03-18 13:01:54.796732 NSTimerTest[1121:267663] link do nothing, linkCount = 38
2017-03-18 13:01:54.813729 NSTimerTest[1121:267663] link do nothing, linkCount = 39
2017-03-18 13:01:54.829980 NSTimerTest[1121:267663] link do nothing, linkCount = 40
2017-03-18 13:01:54.846751 NSTimerTest[1121:267663] link do nothing, linkCount = 41
2017-03-18 13:01:54.863757 NSTimerTest[1121:267663] link do nothing, linkCount = 42
2017-03-18 13:01:54.879957 NSTimerTest[1121:267663] link do nothing, linkCount = 43
2017-03-18 13:01:54.896619 NSTimerTest[1121:267663] link do nothing, linkCount = 44
2017-03-18 13:01:54.913648 NSTimerTest[1121:267663] link do nothing, linkCount = 45
2017-03-18 13:01:54.930006 NSTimerTest[1121:267663] link do nothing, linkCount = 46
2017-03-18 13:01:54.946953 NSTimerTest[1121:267663] link do nothing, linkCount = 47
2017-03-18 13:01:54.963751 NSTimerTest[1121:267663] link do nothing, linkCount = 48
2017-03-18 13:01:54.980065 NSTimerTest[1121:267663] link do nothing, linkCount = 49
3、总结
可以看出来,CADisplayLink“尽量”保证17ms执行一次,主要看NSRunloop中有没有执行其它事件时被阻塞
NSTimer的触发周期最小可以和NSRunloop的循环保持一致,也就是由NSRunloop的执行周期决定,大概2~3ms
因此这也是NSTimer也是不精确的原因
代码:https://github.com/liqiushui/NSRunloop
NSTimer的精确度的更多相关文章
- CADisplayLink以及和NSTimer的区别
什么是CADisplayLink CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器.我们在应用中创建一个新的 CADisplayLink 对象,把它添加到一个r ...
- iOS - OC NSTimer 定时器
前言 @interface NSTimer : NSObject 作用 在指定的时间执行指定的任务. 每隔一段时间执行指定的任务. 1.定时器的创建 当定时器创建完(不用 scheduled 的,添加 ...
- iOS开发中深入理解CADisplayLink和NSTimer
一.什么是CADisplayLink 简单地说,它就是一个定时器,每隔几毫秒刷新一次屏幕. CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器.我们在应用中创建一 ...
- iOS开发--计时器-NSTimer与CADisplayLink
如果程序要让某个方法重复执行,可以借助定时器来完成.CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器,NSTimer的精确度低了点,比如NSTimer的触发时间 ...
- 深入理解CADisplayLink和NSTimer
一.什么是CADisplayLink 简单地说,它就是一个定时器,每隔几毫秒刷新一次屏幕. CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器.我们在应用中创建一 ...
- iOS---->CADisplayLink、比NSTimer更精确的定时器
什么是CADisplayLink CADisplayLink是一个能让我们以和屏幕刷新率相同的频率将内容画到屏幕上的定时器.我们在应用中创建一个新的 CADisplayLink 对象,把它添加到一个r ...
- CADisplayLink & NSTimer
屏幕刷新与UI更新不同步:屏幕刷新由硬件(+GPU)保证,UI更新由软件(CPU保证). 出现卡顿的原因是软件的计算速度跟不上硬件的刷新速度. 一 简介 1 所在框架 CADisplayLink和其它 ...
- iOS中定时器的使用
1. NSTimer 不是很精确 2.CADisplayLink 屏幕 3.通过GCD来实现定时间器 //定时循环执行事件 //dispatch_source_set_timer 方法值得一提的是最后 ...
- Core Animation系列之CADisplayLink
一直以来都想好好学习下CoreAnimation,奈何涉及的东西太多,想要一次性全部搞定时间上不允许,以后会断断续续的补全.最近项目里用到了CADisplayLink,就顺便花点时间看了看. 一.简介 ...
随机推荐
- jquery 全选 全不选 事件绑定
<td width="82%" colspan="3"><input type="checkbox" id="a ...
- HDU5842
Lweb and String Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- ubuntu16.04无法设置选择wifi的解决办法
在公司上班一直连接的有线,直到昨天拿回家才发现ubuntu无法选择使用wifi上网,这让人非常无奈,截图类似如下: 而正常情况下我们应该在启用联网的下面有wifi链接的选项,如图: 我隐约猜测是和驱动 ...
- 计算机程序的思维逻辑 (64) - 常见文件类型处理: 属性文件/CSV/EXCEL/HTML/压缩文件
对于处理文件,我们介绍了流的方式,57节介绍了字节流,58节介绍了字符流,同时,也介绍了比较底层的操作文件的方式,60节介绍了随机读写文件,61节介绍了内存映射文件,我们也介绍了对象的序列化/反序列化 ...
- Linux编程之ICMP洪水攻击
我的上一篇文章<Linux编程之PING的实现>里使用ICMP协议实现了PING的程序,ICMP除了实现这么一个PING程序,还有哪些不为人知或者好玩的用途?这里我将介绍ICMP另一个很有 ...
- bugly集成了Tinker热更新
介绍 热更新能力是Bugly为解决开发者紧急修复线上bug,而无需重新发版让用户无感知就能把问题修复的一项能力.Bugly目前采用微信Tinker的开源方案,开发者只需要集成我们提供的SDK就可以实现 ...
- MongoDB学习总结(四) —— 索引的基本用法
说到索引,大家肯定都在关系型数据库或多或少接触过,它的主要目的是加速查询的速度.MongoDB作为一种数据库,当然也提供了索引的操作. 我们先插入1万条测试数据. 首先,我们先来看看不加索引查找nam ...
- js 将php生成的time()类型时间戳转化成具体date格式的日期
需求: 将首页显示的int类型的时间转化为date类型的时间格式: QuestionModel获取到question列表数据时,包括question['pub_time'],在显示 ...
- E. Devu and Flowers
E. Devu and Flowers time limit per test 4 seconds memory limit per test 256 megabytes input standard ...
- Spring+SpringMVC+MyBatis+easyUI整合基础篇(二)牛刀小试
承接上文,该篇即为项目整合的介绍了. 废话不多说,先把源码和项目地址放上来,重点要写在前面. github地址为ssm-demo 你也可以先体验一下实际效果,点击这里就行啦 账号:admin 密码:1 ...