timing

What causes fluctuating execution times when presenting the Renderbuffer? (OpenGL)

This is what happens: The drawGL function is called at the exact end of the frame thanks to a usleep, as suggested. This already maintains a steady framerate. The actual presentation of the renderbuffer takes place with drawGL(). Measuring the time it takes to do this, gives me fluctuating execution times, resulting in a stutter in m...

How do I time a program executing in Windows?

I want to be able to do the Windows equivalent of this Unix/Linux command: time fooenter code here foo x cpu time y real time z wallclock time ...

Triggering an action at a certain time, is it possible?

I am just looking into development for the iPhone and I was wondering if it is possible to trigger an action at a certain time? Based on what I have read it does not seem like this is currently not an option because there are no background processes allowed. Is this true? If so do you guys/gals have any ideas on alternatives? Thanks ...

Determining the amount of time processes spend Blocking/Executing

OK so for a programming assignment that I have (Yes, we are all allowed to turn to any source we find suitable for help) I have to find out how much time processes spend blocking/sleeping/running. My first attempt was creating a bash script... that looked something like this: for i in `ls /proc/ | egrep [0-9]+` do cat /proc/$i...

Precision timing in .NET

I've just seen this question, where one of the answers indicates that System.Diagnostics.Stopwatch should only be used for diagnosing performance and not in production code. In that case, what would be the best way to get precision timing in .NET. I'm currently in the early stages of building a very simple MIDI sequencer using the MIDI-...

Hide div after a few seconds

Hello guys, I was wondering, how in jquery am I able to hide a div after a few seconds? Like Gmail's messages for example. I've tried my best but am unable to get it working. Thanks! ...

Scriptaculous Animation Timing Question

I have a project using ruby on rails and scriptaculous. I have a periodically running scriptaculous animation running that involves continuously moving elements across the screen. When a user clicks a certain button, I also want to fade a piece of text ontop of this animation asynchronously. However, when I run the scriptaculous appea...

speed of references in C++

Hi, I have been working on a project and trying to find the source of a large slowdown in execution time and have narrowed it down to a single method which I have managed to optimise out of the logic. The problem is that my solution involves using a reference which makes another section of the code run quite slowly... The question I'd li...

How to program a real-time accurate audio sequencer on the iphone?

Hi... I want to program a simple audio sequencer on the iphone but I can't get accurate timing. The last days I tried all possible audio techniques on the iphone, starting from AudioServicesPlaySystemSound and AVAudioPlayer and OpenAL to AudioQueues. In my last attempt I tried the CocosDenshion sound engine which uses openAL and allows...

Network Time Synchronization with Java

Hello everyone. I'm creating a p2p audio-midi streaming application using Java (unfortunately) and I'm searching for a way to provide network time synchronization between certain peers (sources) using a reliable protocol implementation (like NTP) but I can't find any related libraries to use.I also have a limited amount of time to spend ...

Gapless playback of sequential sounds in Flash

I'm making a flash, which is basically a very simple tracker. My question is about sequential playback and more specifically timing problems. The SoundChannel-object conveniently provides a SoundCompleted-event, but relying on that results in tiny gaps between sounds, which (sadly) makes it useless. All I've managed to dig up so far, a...

C# app to C++ dll back to the C# app via callbacks

Hi all, I'm writing a C# application that calls a C++ dll. This dll is a device driver for an imaging system; when the image is being acquired, a preview of the image is available from the library on a line-by-line basis. The C++ dll takes a callback to fill in the preview, and that callback consists basically of the size of the final...

Javascript timing problem.

I wont to run a block of code in a certain amount of time and then when done, carry on with another block of code. ...

How to enable build timing in Xcode?

Hello, I'd like to know how long my project's builds take, for example by displaying it in the build pane. Is this option available somewhere in Xcode? Thanks. ...

Why do more Pentium assembly instructions take less time?

Below is a clip from a listing of two Pentium assembly sequences. We have an outside loop that is trying to time our sequences and is doing a call-through-table to get to these routines. Therefore, the outside call is being made from the same location every time. The two sequences differ in that the first one has one less instruction tha...

How to acquire an event only at defined times?

I have a QWidget which handles the mouseevent, i.e. it stores the mouseposition in a list when the left mouse button is pressed. The problem is, I cannot tell the widget to take only one point every x ms. What would be the usual way to get these samples? Edit: since the mouseevent is not called very often, is it possible to increase th...

How do I ensure my program runs from beginning to end without interruption?

Hi, I'm attempting to time code using RDTSC (no other profiling software I've tried is able to time to the resolution I need) on Ubuntu 8.10. However, I keep getting outliers from task switches and interrupts firing, which are causing my statistics to be invalid. Considering my program runs in a matter of milliseconds, is it possible t...

Java performance timing library

I frequent wrap code in a System.nanoTime() pair in order to timing it. Something like: long start = System.nanoTime(); methodToBeTimed(); long elapsedTime = System.nanoTime() - start; There is any good timing library that helps with this problem? Also homegrown code will be accepted. NB A profiler is not a solution here, since ...

What is a precise way to block a thread for a specific period of time?

The system I'm working on needs to consume an IEnumerable of work items, iterate through each of them, and in between them wait for a certain period of time. I would like to keep the system as simple as possible at the enumeration site. That is, I'd like to have a method that I can call at the end of the foreach block which will block fo...

For my game's main loop what should i consider : DispatcherTimer Vs StoryBoard

I am writing a game in which I want to kick off an event for my game main loop, the event has to be fired after a very small interval of time. DispatcherTimer helped me in implementing that, I came across this article http://blogs.silverlight.net/blogs/msnow/archive/2008/07/09/storyboard-versus-dispatchertimer-for-animation-and-game-...