Questions tagged [delay]

Delay refers to amount of time between two events.

A delay is simply the difference in time between two events.

This may refer to the start and stop of a single event (e.g. data processing delay) or the execution of two separate, independent events.

A delay may be manually implemented by the programmer using sleep or pause functions common in many programming languages.

In the case of computer networks, delay between sending and receiving of data packets is referred to synonymously as latency.

4215 questions
10
votes
3 answers

Adding a delay without Thread.sleep and a while loop doing nothing

I need to add delay without using Thread.sleep() or a while loop doing nothing. The game im editing(Minecraft) clock runs on "Ticks" but they can fluctuate depending on your FPS. public void onTick() {//Called every "Tick" if(variable){ //If my…
user3166950
  • 315
  • 3
  • 6
  • 15
10
votes
2 answers

Box2d: mousejoint without inertial delay

I'm using mousejoint to drag bodies in box2d, but it causes inertial delay. Does it exist any way to drag a body instantaneously?
Ricibald
  • 9,369
  • 7
  • 47
  • 62
10
votes
6 answers

How to set 1 second time delay at assembly language 8086

My problem is that I have written a code that is supposed to output a result into a set of LEDs connected to the parallel port. When I ran the code it pretty much did nothing. My instructor told me that the code ran too fast that my eyes did not see…
Jer Yango
  • 582
  • 2
  • 8
  • 22
10
votes
3 answers

$.ready() before closing body

This is not a real coding question, more of a real-world statement. I have previously noted that DOMReady events are slow, very slow. So, I noticed while browsing the jQuery source that the jQuery domeready event can be trigger using $.ready(). Then…
David Hellsing
  • 106,495
  • 44
  • 176
  • 212
10
votes
4 answers

Wait for function till user stops typing

I have users making ajax call while typing. The problem is that it makes the call for every letter being typed, so I set timeout like this: $(input).live('keyup', function(e){ setTimeout(function(){ var xx = $(input).val(); doSearch(xx); },…
Youss
  • 4,196
  • 12
  • 55
  • 109
9
votes
2 answers

How to make delay between each loops of jQuery.each function?

I have this-like code: $('li').each(function(){ var data = $(this).text(); requestFunction(data, function(status){ if ( status == 'OK' ) do stuff... }); }); So, i need to do some delay between using function "requestFunction()". How…
Ax.
  • 320
  • 3
  • 4
  • 12
9
votes
1 answer

how to stream sound in java without delay using SourceDataLine

I want to generate sounds based on user's action in Java. Even if I set the buffer size in SourceDataLine to the smallest possible value (1 frame) I still have delay of about 1 second. Because a code snippet is worth a thousand words (or was it a…
andi
  • 912
  • 1
  • 10
  • 25
9
votes
3 answers

.mouseleave() with .delay() working together

I have a list of several 'triggers' (
  • s), each trigger shows a specific DIV, and each DIV has 'close' button. Now, I want to improve the usability by adding a timer/delay to the opened/visible DIV so that after3 or 5 seconds after the user has…
  • Ricardo Zea
    • 10,053
    • 13
    • 76
    • 79
    9
    votes
    3 answers

    Swift Combine - delaying a publisher

    TL;DR I want to delay a publication, but can't figure out how to, er, combine the parts In Brief I have a Publisher let generator = PassthroughSubject() and want somehow to use the modifier .delay(for: 2, scheduler: RunLoop.main) so…
    Andrew Duncan
    • 3,553
    • 4
    • 28
    • 55
    9
    votes
    3 answers

    Wait before ShellExecute is carried out?

    I have a hopefully quick question: Is it possible to delay execution of ShellExecute a little bit? I have an application with autoupdater. After it downloads all necessary files etc, it renames current files to *.OLD and the new as the previous.…
    Martin Melka
    • 7,177
    • 16
    • 79
    • 138
    9
    votes
    1 answer

    High delay in RS232 communication on a PXA270

    I'm experiencing a long delay (1.5ms - 9.5ms) in a RS232 communication on a PXA270 RISC PC/104. I want to minimize the long delay but I'm a beginner with embedded devices and C++ so I think I'm missing something. The mentioned delay is at the time…
    saxos
    • 2,467
    • 1
    • 20
    • 21
    9
    votes
    6 answers

    How to delay script/asset loading in Chrome Developer Tools

    Is there any way to add a time delay to a script/asset loading in the Google Chrome Browser via the Chrome Developer Tools? Or to block a script loading entirely? The reason I want to do this is to see how a site performs when a script/asset suffers…
    9
    votes
    2 answers

    iOS: Why touchesBegan has some delay in some specific area in UIView

    I'm making a custom keyboard and I'm in a really weird situation. I've noticed that when I catch the event touchesBegan at the rear left (about 20 pixels) of the UIView (inputView), I'll have some delay in here. Any action I do in touchesBegan will…
    TomSawyer
    • 3,711
    • 6
    • 44
    • 79
    9
    votes
    2 answers

    Shorten the touch delay in a UIScrollView?

    I'm looking to shorten the touch delay on a UIScrollView, but I don't want to use setDelaysContentTouches:NO; I still want there to be a slight delay but my users are complaining about it being too long. Is there a way to do this?
    Missing.Matter
    • 123
    • 2
    • 5
    9
    votes
    3 answers

    How can I delay in a Linux interrupt handler (I know sleeping usually not possible)

    I'm working on an embedded Linux ARM system that needs to react to a power failure signal by turning off some power supplies (via GPIO control) in a specific sequence. This process needs to start as soon as possible, so I've installed an interrupt…
    Steve
    • 6,334
    • 4
    • 39
    • 67