Click here to Skip to main content
15,888,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all , i have a Question .
i need to force 15 seconds delay betwwen 2 mrthod execution .
how can i do this . thanks.
C#
function test(){
method1();
// i want to force delay here
method2();
}
function Method1()
{
// do somthing !
}
function method2()
{
// do somthing !
}
Posted
Updated 25-Aug-13 22:36pm
v2
Comments
Mohibur Rashid 26-Aug-13 4:17am    
function test(){
method1();
// i want to force delay here
setTimeout(function() { method2()}, 15000);

}

You can use plain javascript
JavaScript
setTimeout(function() { your second _func(); }, 15000);

Hope this helps
 
Share this answer
 
Try something like this:-

C#
function test(){
method1();
// i want to force delay here
   setTimeout(function() { Method2() },500) //Set delay time for method 2 appearence
}


function Method1()
{
// do somthing !
}
function method2()
{
// do somthing !
}
 
Share this answer
 
C#
function test() {
            Method1();

            setTimeout(function () {
                Method2();
            }, 2000);

            return false;
        }


        function Method1() {
            alert('This is Method 1');
        }
        function Method2() {
            alert('This is Method 2');
        }

JavaScript

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900