php max_execution_time实际测量的是什么?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php max_execution_time实际测量的是什么?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1834字,纯文字阅读大概需要3分钟。
内容图文
![php max_execution_time实际测量的是什么?](/upload/InfoBanner/zyjiaocheng/650/3ed0365ce5624b078574303cbfe41b1d.jpg)
我有一个网页,上面有一个按钮,单击该按钮即可执行一个php函数.
当用户单击它时,需要51081ms才能返回页面.在我的Firefox开发人员工具中,“网络”选项卡将其中的51376毫秒归类为“等待”.
在我的php.ini文件中声明的max_execution_time为30.我在phpinfo文件中也可以看到此信息.
我的问题是,为什么我的脚本在30秒后不超时? max_execution_time实际测量的是什么?
编辑以包含代码;
public function getSlotsByUser (Request $request) {
$event_id = $request->event_id;
$user_id = substr($request->user, 4);
$event = Event::find($event_id);
$user = User::find($user_id);
$slots = TimeSlot::where('event_id',$event_id)->get();
$userSlots = $user->slots;
foreach($userSlots as $userSlot) {
$guest = Guest::where('slot_id',$userSlot->id)->where('user_id',$user->id)->first();
if($guest) {
$userSlot->guest_id = $guest->id;
$userSlot->guest_name = $guest->name . ' ' . $guest->surname;
}
else {
$userSlot->guest_id = NULL;
$userSlot->guest_name = NULL;
}
$userSlotIds[] = $userSlot->id;
}
$days = new DatePeriod(
new DateTime($event->start_time),
new DateInterval('P1D'),
(new DateTime($event->end_time))->modify('+1 day')
);
return view('admin.calendar',compact('event','slots','user','userSlots','userSlotIds','days'));
}
我了解哪些部分代表使用Eloquent的查询.我的代码也去了;
PHP执行
PHP执行
数据库查询
数据库查询
数据库查询
PHP执行…等?
有人可以向我解释“幕后”发生了什么吗?
解决方法:
max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windouws where the measured time is real.
因此,在Linux上,仅计算用于执行php代码的时间.
“网络”标签中的等待状态只是告诉您,到目前为止,您没有从网络服务器获得任何响应.
内容总结
以上是互联网集市为您收集整理的php max_execution_time实际测量的是什么?全部内容,希望文章能够帮你解决php max_execution_time实际测量的是什么?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。