Questions tagged [delay]
Delay refers to amount of time between two events.
                                	
	delay
    
                            
                        
                    
            4,238
            questions
        
        
            3218
            votes
        
        
            13
            answers
        
        
            3.7m
            views
        
    How do I make a time delay? [duplicate]
                How do I put a time delay in a Python script?
            
        
       
    
            916
            votes
        
        
            36
            answers
        
        
            850k
            views
        
    How to call a method after a delay in Android
                I want to be able to call the following method after a specified delay.
 In objective c there was something like:
[self performSelector:@selector(DoSomething) withObject:nil afterDelay:5];
Is there ...
            
        
       
    
            399
            votes
        
        
            19
            answers
        
        
            534k
            views
        
    How to create a delay in Swift?
                I want to pause my app at a certain in point. In other words, I want my app to execute the code, but then at a certain point, pause for 4 seconds, and then continue on with the rest of the code. How ...
            
        
       
    
            385
            votes
        
        
            1
            answer
        
        
            1.4m
            views
        
    JavaScript sleep/wait before continuing [duplicate]
                I have a JavaScript code that I need to add a sleep/wait function to. The code I am running is already in a function, eg:
function myFunction(time)
{
    alert('time starts now');
    //code to make ...
            
        
       
    
            364
            votes
        
        
            12
            answers
        
        
            1.2m
            views
        
    Proper way to wait for one function to finish before continuing?
                I have two JS functions. One calls the other. Within the calling function, I'd like to call the other, wait for that function to finish, then continue on. So, for example/pseudo code:
function ...
            
        
       
    
            307
            votes
        
        
            10
            answers
        
        
            404k
            views
        
    How to run code after some delay in Flutter?
                I'd like to execute a function after a certain delay after my Widget is built. What's the idiomatic way of doing this in Flutter? 
What I'm trying to achieve:
I'd like to start with a default ...
            
        
       
    
            192
            votes
        
        
            11
            answers
        
        
            190k
            views
        
    jQuery: Can I call delay() between addClass() and such?
                Something as simple as:
$("#div").addClass("error").delay(1000).removeClass("error");
doesn't seem to work. What would be the easiest alternative?
            
        
       
    
            180
            votes
        
        
            4
            answers
        
        
            759k
            views
        
    How to add a delay for a 2 or 3 seconds [closed]
                How can I add a delay to a program in C#?
            
        
       
    
            178
            votes
        
        
            10
            answers
        
        
            594k
            views
        
    jQuery: Wait/Delay 1 second without executing code
                I can't get the .delay method working in jQuery:
$.delay(3000); // not working
$(queue).delay(3000); // not working
I'm using a while loop to wait until an uncontrolled changing value is greater ...
            
        
       
    
            164
            votes
        
        
            4
            answers
        
        
            178k
            views
        
    Delaying function in swift [duplicate]
                I don't have a code to sample or anything, because I have no idea how to do it, but can someone please tell me how to delay a function with swift for a set amount of time?
            
        
       
    
            149
            votes
        
        
            13
            answers
        
        
            143k
            views
        
    How to put a delay on AngularJS instant search?
                I have a performance issue that I can't seem to address. I have an instant search but it's somewhat laggy, since it starts searching on each keyup().
JS:
var App = angular.module('App', []);
App....
            
        
       
    
            133
            votes
        
        
            6
            answers
        
        
            31k
            views
        
    How to reduce iOS AVPlayer start delay
                Note, for the below question:  All assets are local on the device -- no network streaming is taking place.  The videos contain audio tracks.
I'm working on an iOS application that requires playing ...
            
        
       
    
            121
            votes
        
        
            12
            answers
        
        
            174k
            views
        
    Delayed function calls
                Is there a nice simple method of delaying a function call whilst letting the thread continue executing?
e.g.
public void foo()
{
    // Do stuff!
    // Delayed call to bar() after x number of ms
 ...
            
        
       
    
            98
            votes
        
        
            3
            answers
        
        
            279k
            views
        
    How can I delay a :hover effect in CSS?
                Is there a way to delay the :Hover event without using JavaScript? I know there is a way to delay animations, but I haven't seen anything on delaying the :hover event.
I'm building a son-of-...
            
        
       
    
            96
            votes
        
        
            15
            answers
        
        
            182k
            views
        
    While variable is not defined - wait
                I have a click event that is triggered from another place automatically for the first time. My problem is that it runs too soon, since the required variables are still being defined by Flash and web ...
            
        
       
    
            96
            votes
        
        
            7
            answers
        
        
            140k
            views
        
    CSS Animations with delay for each child element
                I am trying to create a cascading effect by applying an animation to each child element. I was wondering if there is a better way to do it than this:
.myClass img:nth-child(1){
    -webkit-animation: ...
            
        
       
    
            88
            votes
        
        
            7
            answers
        
        
            122k
            views
        
    Adding delay between execution of two following lines
                I need to add a delay between the execution of two lines in a(same) function. Is there any favorable option to do this?
Note: I don't need two different functions to do this, and the delay must not ...
            
        
       
    
            86
            votes
        
        
            5
            answers
        
        
            139k
            views
        
    How can I use delay() with show() and hide() in Jquery
                How can I use delay() with show() and hide() in Jquery ?
            
        
       
    
            80
            votes
        
        
            5
            answers
        
        
            141k
            views
        
    How to add random delays between the queries sent to Google to avoid getting blocked in python
                I have written a program which sends more than 15 queries to Google in each iteration, total iterations is about 50. For testing I have to run this program several times. However, by doing that, after ...
            
        
       
    
            74
            votes
        
        
            17
            answers
        
        
            68k
            views
        
    RxJava delay for each item of list emitted
                I'm struggling to implement something I assumed would be fairly simple in Rx.
I have a list of items, and I want to have each item emitted with a delay.
It seems the Rx delay() operator just shifts ...
            
        
       
    
            68
            votes
        
        
            5
            answers
        
        
            69k
            views
        
    Delay or Wait-For Statement
                I have a 500,000 line SQL script:
UPDATE users SET region_id = 9814746 WHERE id = 101 AND region_id IS null;
UPDATE users SET region_id = 9814731 WHERE id = 102 AND region_id IS null;
UPDATE users SET ...
            
        
       
    
            59
            votes
        
        
            5
            answers
        
        
            162k
            views
        
    How to minimize the delay in a live streaming with ffmpeg
                i have a problem.
I would to do a live streaming with ffmpeg from my webcam. 
I launch the ffserver and it works.
From another terminal I launch ffmpeg to stream with this command
and it works:
sudo ...
            
        
       
    
            57
            votes
        
        
            3
            answers
        
        
            76k
            views
        
    Measure website load time with Python requests
                I'm trying to build a tool for testing the delay of my internet connection, more specifically web site load times. I thought of using the python requests module for the loading part.
Problem is, it's ...
            
        
       
    
            57
            votes
        
        
            4
            answers
        
        
            28k
            views
        
    Is setTimeout with no delay the same as executing the function instantly?
                I am looking at some existing code in a web application. I saw this:
window.setTimeout(function () { ... })
Is this the same as just executing the function content right away?
            
        
       
    
            52
            votes
        
        
            6
            answers
        
        
            38k
            views
        
    How to create a delayed queue in RabbitMQ?
                What is the easiest way to create a delay (or parking) queue with Python, Pika and RabbitMQ? I have seen an similar questions, but none for Python. 
I find this an useful idea when designing ...
            
        
       
    
            43
            votes
        
        
            4
            answers
        
        
            65k
            views
        
    jQuery: append() object, remove() it with delay()
                what's wrong with that?
$('body').append("<div class='message success'>Upload successful!</div>");
$('.message').delay(2000).remove();
I want to append a success message to my html ...
            
        
       
    
            41
            votes
        
        
            7
            answers
        
        
            48k
            views
        
    How to create delay function in QML?
                I would like to create a delay function in javascript that takes a parameter of amount of time to delay, so that I could use it do introduce delay between execution of JavaScript lines in my QML ...
            
        
       
    
            41
            votes
        
        
            1
            answer
        
        
            6k
            views
        
    How windows handle the clipboard interface with Xming?
                My question comes from a problem:
I Use Xming on Windows 7 to connect to a Linux host (through PuTTY) in order to start and display a gnome-terminal.
I have some troubles using the Windows clipboard:
...
            
        
       
    
            40
            votes
        
        
            11
            answers
        
        
            56k
            views
        
    Dismiss UIAlertView after 5 Seconds Swift
                I've created a UIAlertView that contains a UIActivityIndicator. Everything works great, but I'd also like the UIAlertView to disappear after 5 seconds. 
How can I Dismiss my UIAlertView after 5 ...
            
        
       
    
            37
            votes
        
        
            6
            answers
        
        
            121k
            views
        
    Flutter/Dart - Open a view after a delay
                I'm trying to find a solution to open a view after a delay in a loading view. I have a View, in which there is a button and when I press it, the onPressed() method triggers a Navigator.of(Context)....
            
        
       
    
            37
            votes
        
        
            5
            answers
        
        
            212k
            views
        
    How can I perform a short delay in C# without using sleep?
                I'm incredibly new to programming, and I've been learning well enough so far, I think, but I still can't get a grasp around the idea of making a delay the way I want. What I'm working on is a sort of ...
            
        
       
    
            35
            votes
        
        
            17
            answers
        
        
            168k
            views
        
    implement time delay in c
                I don't know exactly how to word a search for this.. so I haven't had any luck finding anything.. :S
I need to implement a time delay in C.
for example I want to do some stuff, then wait say 1 ...
            
        
       
    
            35
            votes
        
        
            4
            answers
        
        
            63k
            views
        
    Delay automatic url redirect with jquery?
                I need a transition page that will display for 2 seconds before automatically redirecting to the home page. How do I do this? I can't seem to get delay to work for me.
            
        
       
    
            34
            votes
        
        
            4
            answers
        
        
            47k
            views
        
    Delay Actions in Swift
                I want to make an Activity Indicator start animating and then stop after one second.
So does anyone know how I could do that?
class stuff {
@IBOutlet weak var indicator: UIActivityIndicatorView!
   ...
            
        
       
    
            33
            votes
        
        
            7
            answers
        
        
            118k
            views
        
    Xcode Objective-C | iOS: delay function / NSTimer help?
                So I'm developing my first iOS application and I need help..
Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just want the first button to highlight ...
            
        
       
    
            33
            votes
        
        
            3
            answers
        
        
            11k
            views
        
    Idiomatic jQuery delayed event (only after a short pause in typing)? (aka timewatch/typewatch/keywatch)
                Here is some jQuery for a search box that I expect is actually an antipattern, and am sure there is a much better solution for that I would love to be pointed towards:
I will describe it in comments ...
            
        
       
    
            32
            votes
        
        
            9
            answers
        
        
            77k
            views
        
    Add a delay after executing each iteration with forEach loop
                Is there an easy way to slow down the iteration in a forEach (with plain javascript)? For example:
var items = document.querySelector('.item');
items.forEach(function(el) {
  // do stuff with el and ...
            
        
       
    
            31
            votes
        
        
            5
            answers
        
        
            25k
            views
        
    delaying actions between keypress in jQuery
                How can I delay actions between keypress in jQuery.
For example;
I have something like this
 if($(this).val().length > 1){
   $.post("stuff.php", {nStr: "" + $(this).val() + ""}, function(data){
 ...
            
        
       
    
            30
            votes
        
        
            6
            answers
        
        
            66k
            views
        
    display data after every 10 seconds in Android
                I have to display some data after every 10 seconds. Can anyone tell me how to do that?
            
        
       
    
            28
            votes
        
        
            6
            answers
        
        
            231k
            views
        
    Javascript sleep/delay/wait function
                Sorry if this question has already been asked here before, I could not find a suitable answer.
I am wanting to create a JavaScript sleep/delay/wait function that I can call anywhere in the script, ...
            
        
       
    
            28
            votes
        
        
            4
            answers
        
        
            28k
            views
        
    OnKeyUp JavaScript Time Delay?
                Hi Again Masters Of The Web :)
Now, I have got a new stupid question, and I am asking to forgive me. I read everywhere about this solution, but didn't find the one that works for me.
I have got:
<...
            
        
       
    
            27
            votes
        
        
            3
            answers
        
        
            204k
            views
        
    How to create javascript delay function [duplicate]
                I have a javascript file, and in several places I want to add a small delay, so the script would reach that point, wait 3 seconds, and then continue with the rest of the code. The best way that I ...
            
        
       
    
            26
            votes
        
        
            4
            answers
        
        
            124k
            views
        
    Java Delay/Wait
                How do I delay a while loop to 1 second intervals without slowing down the entire code / computer it's running on to the one second delay (just the one little loop).
            
        
       
    
            25
            votes
        
        
            2
            answers
        
        
            45k
            views
        
    Can I put delay(500) before an addClass()?
                $(document).ready(function(){
    $("#info-text-container").click(function(){
        $("#info-text").delay(500).addClass("info-text-active");
    });   
});
This does not put an delay on it when it ...
            
        
       
    
            25
            votes
        
        
            3
            answers
        
        
            76k
            views
        
    fade out div after x seconds with jquery
                I do a fade in div that is not displayed when I load the page:
    $('#overlay').fadeIn('fast');
    $('#box').fadeIn('slow');
I would do this instructions after x seconds, doing a fadeOut of the ...
            
        
       
    
            25
            votes
        
        
            12
            answers
        
        
            187k
            views
        
    How to make java delay for a few seconds?
                Hey all I have this code. I want to delay my program for a few seconds and display "scanning..."
Here's what I have. This compiles but doesn't delay anything
int i = 1;
if (i == 1) {
    try ...
            
        
       
    
            24
            votes
        
        
            11
            answers
        
        
            56k
            views
        
    Delay load of iframe?
                I know there are some tools and techniques for delaying the load of javascript, but I have an iframe that I would like to delay loading until after the rest of the page has finished downloading and ...
            
        
       
    
            24
            votes
        
        
            3
            answers
        
        
            29k
            views
        
    JQuery delay before fadeOut
                I have written a jquery script that allows me to fade divs in and out, then repeat. The code works fine. However, when I try to add a delay (I want the div to stay up a few seconds before fading out), ...
            
        
       
    
            24
            votes
        
        
            10
            answers
        
        
            47k
            views
        
    How to cancel queued job in Laravel or Redis
                How can I browse all the pending jobs within my Redis queue so that I could cancel the Mailable that has a certain emailAddress-sendTime pair?
I'm using Laravel 5.5 and have a Mailable that I'm using ...
            
        
       
    
            23
            votes
        
        
            4
            answers
        
        
            16k
            views
        
    MockWebServer response delay - testing timeouts
                I'm trying to test HTTP timeout scenarios using a MockWebServer which answers my test requests sent with Retrofit/OkHttp. (This question was asked before some years ago, but at the time concerned a ...