delay

High delay in RS232 communication on a PXA270

喜欢而已 提交于 2019-12-17 13:56:18
问题 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 when the PXA board receives a packet from the external device via RS232 (115200 baud) until it sends an ACK custom packet back to the external device. I measured the delay on the PXA board with an oscilloscope, one channel at the Rx and the other on

Delaying function in swift [duplicate]

烈酒焚心 提交于 2019-12-17 10:12:40
问题 This question already has answers here : dispatch_after - GCD in Swift? (23 answers) Closed 3 years ago . 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? 回答1: You can use GCD (in the example with a 10 second delay): Swift 2 let triggerTime = (Int64(NSEC_PER_SEC) * 10) dispatch_after(dispatch_time(DISPATCH_TIME_NOW, triggerTime), dispatch_get_main_queue(), { () -> Void in

Add a delay after executing each iteration with forEach loop

谁说我不能喝 提交于 2019-12-17 09:45:29
问题 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 pause before the next el; }); 回答1: What you want to achieve is totally possible with Array#forEach — although in a different way you might think of it. You can not do a thing like this: var array = ['some', 'array', 'containing', 'words']; array.forEach(function (el) { console.log(el); wait(1000); /

implement time delay in c

无人久伴 提交于 2019-12-17 09:40:12
问题 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 minute, then continue on doing stuff. Did that make sense? Can anyone help me out? 回答1: In standard C (C99), you can use time() to do this, something like: #include <time.h> : void waitFor (unsigned int secs) { unsigned int retTime = time(0) + secs; // Get finishing time. while (time(0) < retTime); //

Delay to next function in method chain

自闭症网瘾萝莉.ら 提交于 2019-12-17 07:40:33
问题 I am trying to learn more about Method chaining in Javascript and would like to know the proper way to create a delay with no jQuery to the next function in the chain: var foo = function() { this.delay = function(per) { setTimeout(start, per); return this; }; this.start = function() { alert('start!'); }; }; var bar = new foo().delay(1000).start(); 回答1: This isn't easy to do. jQuery uses a specific queue system. Suppose you want to do it without jQuery, you would have to implement a queue

How to add a delay for a 2 or 3 seconds [closed]

一曲冷凌霜 提交于 2019-12-17 07:14:12
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . How can I add a delay to a program in C#? 回答1: You could use Thread.Sleep() function, e.g. int milliseconds = 2000; Thread.Sleep(milliseconds); that stops the execution of the current thread for 2 seconds. Anyway

How to create javascript delay function [duplicate]

血红的双手。 提交于 2019-12-17 06:10:01
问题 This question already has answers here : What is the JavaScript version of sleep()? (75 answers) Closed 5 years ago . 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 thought of doing this was to create a function, which I could call from anywhere in the script. function startDelay(lengthOfDelay) { //code to make it delay for lengthOfDelay amount

display data after every 10 seconds in Android

别等时光非礼了梦想. 提交于 2019-12-17 05:50:49
问题 I have to display some data after every 10 seconds. Can anyone tell me how to do that? 回答1: There is an another way also that you can use to update the UI on specific time interval. Above two options are correct but depends on the situation you can use alternate ways to update the UI on specific time interval. First declare one global varialbe for Handler to update the UI control from Thread, like below Handler mHandler = new Handler(); Now create one Thread and use while loop to periodically

How can I use delay() with show() and hide() in Jquery

穿精又带淫゛_ 提交于 2019-12-17 04:27:46
问题 How can I use delay() with show() and hide() in Jquery ? 回答1: Pass a duration to show() and hide() : When a duration is provided, .show() becomes an animation method. E.g. element.delay(1000).show(0) DEMO 回答2: Why don't you try the fadeIn() instead of using a show() with delay(). I think what you are trying to do can be done with this. Here is the jQuery code for fadeIn and FadeOut() which also has inbuilt method for delaying the process. $(document).ready(function(){ $('element').click

CSS Animations with delay for each child element

坚强是说给别人听的谎言 提交于 2019-12-17 03:00:13
问题 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: myAnimation 0.9s linear forwards; } .myClass img:nth-child(2){ -webkit-animation: myAnimation 0.9s linear 0.1s forwards; } .myClass img:nth-child(3){ -webkit-animation: myAnimation 0.9s linear 0.2s forwards; } .myClass img:nth-child(4){ -webkit-animation: myAnimation 0.9s linear 0.3s forwards; }