我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP脚本等待前一个完成

I have this example script:

<?php
    $time = time();
    shell_exec('nohup sleep 30 2>/tmp/test >/tmp/test &');
    $time2 = time();
    echo $time2 - $time;
?>

when I run it for the first time it show immediately 0 , but when I run it for the second time it wait for the sleep command to finish the it shows the 0. what should i do to make it run immediately without waiting for the sleep command ?

近期文章

  • 使用php上传文件并在mysql列中插入其路径
  • 删除php表中每一行的按钮
  • 如何在htaccess中重写页面名称
  • 从openssl配置确定加密强度
  • php解析多个json文件,循环并在表中显示它
  • PHP Sql语句从MySQL导出表数据
  • 尝试上传图像时,base64_decode返回null
  • 根据物理位置限制特定页面访问
  • Windows服务器中PHP错误报告的奇怪行为
  • 如何在TemplaVoila FCE中使用php文件的输出?
  • 使URL不可读
  • PHP while($ x = mysql_fetch_array($ y))
  • PHP CLI:UTF8问题
  • 从浏览器隐藏API密钥
  • 在命名空间下使用AnnotationReader
  • 如何禁用cakephp中的选择框
  • 使用ajax和php将数据插入MySQL
  • Java:HTTP post多维数组
  • 如何为shopify oauth提供静态网址?
  • 在PhantomJS中使用seeElement()时出错

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华