delay

Mac OS, console application. performSelector:withObject:afterDelay: doesn't work?

时光毁灭记忆、已成空白 提交于 2019-12-02 17:59:18
问题 I created a simple singleton and run method in it: - (void)run { static int times = 0; NSLog(@"times = %d", times++); [self performSelector:@selector(run) withObject:nil afterDelay:MIN_DELAY]; } But it doesn't work properly. It is executed only once. But if I replace performSelector:withObject:afterDelay: with performSelector: then it will be called a lot of times (but I need a delay between calls). So why method performSelector:withObject:afterDelay: doesn't work? And can I use this method

How to minimize the delay in a live streaming with ffmpeg

て烟熏妆下的殇ゞ 提交于 2019-12-02 15:52:28
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 ffmpeg -re -f video4linux2 -i /dev/video0 -fflags nobuffer -an http://localhost:8090/feed1.ffm In my configuration file I have this stream: <Stream test.webm> Feed feed1.ffm Format webm NoAudio VideoCodec libvpx VideoSize 720x576 VideoFrameRate 25 # Video settings VideoCodec libvpx VideoSize 720x576 # Video resolution VideoFrameRate 25 # Video FPS AVOptionVideo flags +global_header # Parameters

jquery delay between javascript functions

巧了我就是萌 提交于 2019-12-02 13:22:11
I have multiply functions with parameters simplified as: function f1(p1,p2){ alert('Function one is P1:'+p1+' P2:'+p2); } function f2(p1,p2){ alert('Function two is P1:'+p1+' P2:'+p2); } I need to fire these is a sequence with a delay between. I have however found that jQuery dislikes running functions with parameters. I have tried the .click function. $.delay(1000).click(f1('One',false)).delay(1000).click(f2('One',false)); But the delay makes the click functions not work... I would just use a simple timeout: f1("one", false); setTimeout(function() { f2("one", false); }, 1000); $.delay(1000)

How can I update the value of a Label control periodically?

无人久伴 提交于 2019-12-02 12:59:07
I'm trying to make a label display some text, and then after a short while refresh itself and be able to re-display something else later. At the moment however I don't know how to make a label pause (if at all possible). My code so far: foreach (var x in mod) { labelWARNING.Visible = true; labelWarningMessage.Text = "This module has a prerequisite module: " + x; //need a pause here to give user sufficient time to read the above text //labelWarningMessage.Text = ""; } From your questions, it seems you need to change the value of something like a status label to display information periodically

android substuting the click with a timer

一世执手 提交于 2019-12-02 12:28:26
问题 I found this example and i have a small question: How can I remove the on click to a timer or a delay where it displays the first image and waits a couple of seconds then moves to the next image? http://mobile.dzone.com/news/displaying-images-sd-card?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobby+%2F+Java+Zone%29 Thank you. package blog.android.sdcard; import android.app.Activity; import android.content.Context; import android.content.Intent;

jQuery .delay does not delay

自作多情 提交于 2019-12-02 11:41:22
How can I set the html of an element, wait 2 seconds, then set the html to something else? Example: $("div").html("clicked").delay(2000).html("2 seconds have passed"); What happens: the div gets "2 seconds have passed" off the bat, instead of saying "clicked" for 2 seconds, then displaying "2 seconds have passed". Do I need to do something like, .delay(2000, function() { $("div").html("2 seconds have passed"); }) ? Live example here: http://jsbin.com/UfaYusU/1/edit Thanks! $.delay is used to delay animations in a queue, not halt execution. Try this: setTimeout(function() { // Do something

LPC1768 / ARM Cortex-M3 microsecond delay

旧城冷巷雨未停 提交于 2019-12-02 11:26:45
问题 I'm trying to implement a microsecond delay in a bare metal arm environment( LPC1768 ) / GCC. I've seen the examples that use the SysTimer to generate an interrupt that then does some counting in C, which is used as a time base https://bitbucket.org/jpc/lpc1768/src/dea43fb213ff/main.c However at 12MHz system clock I don't think that will scale very well to microsecond delays. Basically the processor will spend all it's time servicing the interrupt. Is it possible to query the value of SYSTICK

Implementing a pause in WPF

北城余情 提交于 2019-12-02 10:37:20
问题 Here you have a simple WPF program: <!-- Updater.xaml --> <Window x:Class="Update.Updater" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" DataContext="{Binding RelativeSource={RelativeSource Self}}"> <Grid> <StackPanel> <Button Click="Button_Click" Height="50"></Button> <Label Content="{Binding Label1Text}" Height="50"></Label> <Label Content="{Binding Label2Text}" Height="50"

Mac OS, console application. performSelector:withObject:afterDelay: doesn't work?

拟墨画扇 提交于 2019-12-02 08:36:13
I created a simple singleton and run method in it: - (void)run { static int times = 0; NSLog(@"times = %d", times++); [self performSelector:@selector(run) withObject:nil afterDelay:MIN_DELAY]; } But it doesn't work properly. It is executed only once. But if I replace performSelector:withObject:afterDelay: with performSelector: then it will be called a lot of times (but I need a delay between calls). So why method performSelector:withObject:afterDelay: doesn't work? And can I use this method at all? Calls to -performSelector:withObject:afterDelay: require a run loop. Console applications do not

Java Wait Function

Deadly 提交于 2019-12-02 08:32:31
I was wondering if you guys could help me out. I'm trying to make an animation program with Java's built in graphics module... The thing is, Java executes everything at once; there isn't any time between the different animations. The end product is just the last picture. I need a function that puts like half a second in between each of the pictures. Any help is appreciated. Specs: Blue-J, JDK 6. Edit: Btw, I'm a Java Newbie, and this is a class thing. The assignment was to make an animation, and press 'c' to go forward each frame, but I think thats kinda ghetto, so I want something better.