timing

Is it possible to get a history of queries made in postgres

Is it possible to get a history of queries made in postgres? and is it be possible to get the time it took for each query? I'm currently trying to identify slow queries in the application I'm working on. I'm using Postgres 8.3.5 ...

VB.NET - Precise Time

I need access to very precise timing in a .NET application. I need microsecond precision. Is there an easy way to do this in .NET? ...

KeyListener and timing

Hello, I am writing program in Java will have to do with music input. I want to use my computer keyboard as instrument.Pretty much it will be as button accordion which I play. I will do the mapping between keys and notes through 2 octaves for beginning. I was thinking what would be good design in timing how much the key was pressed. I a...

Timing program runtimes in visual C++

Hello everyone, Is there a quick and easy way of timing a section of a program (or the entire thing) without having to setup a timer class, functions, and variables inside my program itself? I'm specifically referring to Visual C++ (Professional 2008). Thanks, -Faken Edit: none of these answers do what i ask for, i would like to b...

Time measurement in ASP.NET page

I have a normal asp.net page containing some code that I want to measure the execution time of. I have created a very basic helper class for this purpose: public class Timing { private long m_ticksBefore; private long m_ticksAfter; public void Before() { m_ticksBefore = DateTime.Now.Ticks; } public void...

timeit versus timing decorator

I'm trying to time some code. First I used a timing decorator: #!/usr/bin/env python import time from itertools import izip from random import shuffle def timing_val(func): def wrapper(*arg,**kw): '''source: http://www.daniweb.com/code/snippet368.html''' t1 = time.time() res = func(*arg,**kw) t2 = t...

Walkcycles and timing in pygame

I have a pygame.Timer running in my game calling a draw function 32 times/second. The drawing method gets positions from all elements on my screen and blits them accordingly. However, I want the main character to walk around slower than other objects move. Should I set up a timer specifically for it or should I just blit the same frames...

jquery slide and timing

hey there, i have a div that expands when the page is loaded, now i need it to collapse after 30 seconds, does anybody have an idea about how to do it in query? $(function(){ $("#banner").slideDown(); }); ...

What happens when QueryPerformanceCounter is called?

I'm looking into the exact implications of using QueryPerformanceCounter in our system and am trying to understand it's impact on the application. I can see from running it on my 4-core single cpu machine that it takes around 230ns to run. When I run it on a 24-core 4 cpu xeon it takes around 1.4ms to run. More interestingly on my machin...

Serial programming: measuring time between characters

I am sending/receiving data over a serial line in Linux and I would like to find the delay between characters. Modbus uses a 3.5 character delay to detect message frame boundaries. If there is more than a 1.5 character delay, the message frame is declared incomplete. I'm writing a quick program in C which is basically fd = open(MODEM...

Jquery fadein and out

Check this out: http://novarose.co.cc/web2/ Fade effects are kinda messed up and I do not how to make then work properly. I want code to run in following sequence: Fade out block Insert new content Fade in block My jQuery code for that page: $('#navigation a').click(function(){ $.get("page.php", { page: $(this).attr('id') }, f...

Accurate Timings with Oscilloscopes on PC

In the world of embedded software (firmware) it is fairly common to observe the order of events, take timings and optimise a program by getting it to waggle PIO lines and capturing their behavior on an oscilloscope. In days gone by it was possible to toggle pins on the serial and parallel ports to achieve much the same thing on PC-based...

Worst case operating system clock precision?

I am not sure if this question belongs on StackOverflow but here it is. I need to generate a timestamp using C# for some data which is to be transferred from one party to another party and I need to know what is the worst case precision of the system clock in all operating system (Windows, Linux and Unix)? What I need is to figure out t...

Windows/Linux for real time systems (timing)

I am doing a research about real time capabilities of non-real time systems. I am particularly interested in the timing constraints of Windows (any version except CE) and Linux (except the real time ones). Especially my research is concentrating on the accuracy of timing on these platforms and requirements of the system to overcome the ...

Stack vs. heap storage

This program sorts input lines lexicographically, and I've come to this exercise in K&R: Rewrite readlines to store lines in an array supplied by main, rather than calling alloc to maintain storage. How much faster is the program? The original program is the same, just it used alloc to maintain storage for lines. So I edited it th...

Timing of wcf calls in silverlight

Everyone knows that in Silverlight all wcf service calls are asynchronous. But what can we say about the timing of the requests? For the following code, is it always true that "Hello A" will be received by the server before "Hello B"? ServiceClient proxy = new ServiceClient(); ServiceClient proxy2 = new ServiceClient(); proxy.SayHello...

Getting the last second of the Day

In PHP 5.2, how to get the last second in a day? time() + 86400 gets the next Day only? ...

JavaScript event sequence

Some events in JavaScript fire before others. For example, with an input element, the keydown and keypress events fire first. Then, if the return value from those was not false, the input.value is updated. Then, the keyup event fires. Is there a web site where I can find a comprehensive list of all events and the order in which they are...

PHP: Time speed of functions, but it's too fast?

I've REALLY been wanting to test speeds of regex etc. and on php.net it has this example: $time_start = microtime(true); // Sleep for a while usleep(100); // Or anything for that matter.. $time_end = microtime(true); $time = $time_end - $time_start; echo "Did nothing in $time seconds\n"; EDIT: What I meant was to play a large loop ...

jQuery Timed Event

Is it possible, using jQuery, to fire off an event to set a div tag's text after n. seconds? Thanks! George ...