Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:16:19+00:00 2026-06-12T08:16:19+00:00

is it possible to wait for 20 secs before it run the script? I

  • 0

is it possible to wait for 20 secs before it run the script?

I mean I try set_time_limit(20) but when I click the button, it always run the script.

I guess the time limit was just for the time limit when the script running then it will stop.

im looking for a function that can help me for my script to wait for 20 secs. I know it will work on jQuery but im holding right was Yii framework.

I have sample script below

$coco = mysql_query( "SELECT * FROM gameWaiting" );
if ( empty( $coco ) ) {
mysql_query( "INSERT INTO gameWaiting VALUE('', '$email', '$language')" );
$status = 0; // IF THE STATUS is equal to 0 means the db was empty so it will insert
// AND WAIT FOR OTHER PLAYER TO INSERT ALSO
} else {
mysql_query( "INSERT INTO gameWaiting VALUE('', '$email', '$language')" );
$status = 1; // IF THE STATUS is equal to 1 means the db was !empty so it will insert also
// BUT THERE is no need to wait for other player otherwise RAND() the user.
}

// NOW SET TIME HERE when it will INSERT to the game
if ( time was equal to set) {
// IF SOMEONE insert into gameWaiting it will create game
mysql_query( "INSERT INTO game VALUE('','name','email','language')" );
} else {
// No player was added
}

echo $status;

I hope this is possible…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:16:20+00:00Added an answer on June 12, 2026 at 8:16 am

    set_time_limit() specifies the maximum execution time for the script, not the time to wait until executing it (see the Docs).

    You can use PHP’s sleep() function to force execution to delay by a given number of seconds:

    sleep(20); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to wait for a period of time after a function run
Is it possible to wait for user touch inside a while loop? I mean,
Is it possible to have a php script pause at a certain point wait
Possible Duplicate: How can I run a child process that requires elevation and wait?
Is it possible to run an application with PowerShell and wait until it is
in robotium testing, is it possible to set a wait time between clicks? For
Isn't it possible that notify() in another thread gets called before the wait() in
In JavaScript it is possible to wait for onLoad which may be used to
Possible Duplicate: raw_input and timeout raw_input() will wait for user input. How to make
I know it is possible to use jQuery to do something like: $('body').css('cursor','wait'); What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.