timing

What time should I build to production?

My users use the site pretty equally 24/7. Is there a meme for build timing? International audience, single cluster of servers on eastern time, but gets hit well into the morning, by international clients. 1 db, several web servers, so if no db, simple, whenever. But when the site has to come down, when would you, as a programmer be l...

C++ timing, milliseconds since last whole second

I'm working on a C++ application that needs detailed timing information, down to the millisecond level. We intend to gather the time to second accuracy using the standard time() function in . We would like to additionally gather the milliseconds elapsed since the last second given by time(). Does anyone know a convenient method fo...

Testing your code for speed?

I'm a total newbie, but I was writing a little program that worked on strings in C# and I noticed that if I did a few things differently, the code executed significantly faster. So it had me wondering, how do you go about clocking your code's execution speed? Are there any (free)utilities? Do you go about it the old-fashioned way with a...

Timed events with php/MySQL

I need a way to modify a value in a table after a certain amount of time has passed. My current method is as follow: insert end time for wait period in table when a user loads a page requesting the value to be changed, check to see if current >= end time if it is, change the value and remove the end time field, if it isn't, do nothing...

How can I find the execution time of a section of my program in C?

I'm trying to find a way to get the execution time of a section of code in C. I've already tried both time() and clock() from time.h, but it seems that time() returns seconds and clock() seems to give me milliseconds (or centiseconds?) I would like something more precise though. Is there a way I can grab the time with at least microseco...

How do I time a method's execution in Java?

It seems like it should be simpler than it is to get a method's execution time. Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want. ...

Microsecond accurate (or better) process timing in Linux

I need a very accurate way to time parts of my program. I could use the regular high-resolution clock for this, but that will return wallclock time, which is not what I need: I needthe time spent running only my process. I distinctly remember seeing a Linux kernel patch that would allow me to time my processes to nanosecond accuracy, ex...

getting elapsed time since process start

I need a way to get the elapsed time (wall-clock time) since a program started, in a way that is resilient to users meddling with the system clock. On windows, the non standard clock() implementation doesn't do the trick, as it appears to work just by calculating the difference with the time sampled at start up, so that I get negative v...

Are Sql Triggers synchronous or asynchronous?

I have a table that has an insert trigger on it. If I insert in 6000 records into this table in one insert statement from a stored procedure, will the stored procedure return before the insert trigger completes? Just to make sure that I'm thinking correctly, the trigger should only be called (i know 'called' isn't the right word) once b...

Time Code in PLT-Scheme

I want to see how long a function takes to run. What's the easiest way to do this in PLT-Scheme? Ideally I'd want to be able to do something like this: > (define (loopy times) (if (zero? times) 0 (loopy (sub1 times)))) > (loopy 5000000) 0 ;(after about a second) > (timed (loopy 5000000)) Took: 0.93 se...

Javascript Timing

I am trying to create a countdown using javascript. I got some code from here and modified it slighly. <script type="text/javascript"> var c=10; var t; function timedCount() { document.getElementById('txt').value=c; c=c-1; t=setInterval("timedCount()",1000); } function stopCount() { clearInterval(t); } </script> I need to call a c...

How to timestamp request logs with millisecond accuracy in Apache 2.0

How do I configure Apache 2.0's log format so that it timestamps each request log with millisecond (or microsecond) accuracy? The docs say that timestamps are specified in strftime format and strftime doesn't seem to handle anyting smaller than seconds. ...

How do I delay a vb.net program until a file operation completes?

I have this: Dim myTemp As String myTemp = System.DateTime.Now().ToString("MMMddyyyy_HHmmss") & ".pdf" System.IO.File.Copy(myFile, "c:\" & myTemp) Application.DoEvents() OpenFile(myTemp) The problem is that when I call OpenFile, which is just a call to a sub that opens a file, it cannot find the file. This is bec...

jQuery scope or race condition in AJAX/getJSON

I have a piece of jQuery code which invokes several getJSON() calls in quick succession: var table = $("table#output"); for (var i in items) { var thisItem = items[i]; $.getJSON("myService", { "itemID": thisItem }, function(json) { var str = "<tr>"; str += "<td>" + thisItem + "</td>"; str += "<td>" + json...

Best timing method in C?

What is the best way to time a code section with high resolution and portability? /* Time from here */ ProcessIntenseFunction(); /* to here. */ printf("Time taken %d seconds %d milliseconds", sec, msec); Is there a standard library that would have a cross-platform solution? ...

Does threading behaviour of eval() vary across different browsers?

I am currently logging an AJAX application with messages which include the times of certain interactions. So I have a couple of places where the code follows a pattern such as this: var startTime = new Date(); this.doFunction(); var endTime = new Date(); logger.log("doFunction took " + (endTime - startTime) + " milliseconds."); What...

What is the best way to measure Client Side page load times?

I'm looking to monitor the end user experience of our website and link that with timing information already logged on the server side. My assumption is that this will require javascript to to capture time stamps at the start of request (window.onbeforeunload) and at the end of loading (window.onload). Basically this - "Measuring Web appl...

Java equivelant of setInterval in javascript

Basically I want a function to be called every say, 10 milliseconds. How can I achieve that in Java? ...

Global timing of ASP.Net pages

I've just inherited a website (ASP.Net 2.0) written by someone else that I need to maintain. The code is not horrible, but it has a number of things that make the website run incredibly slow. I have an idea to monitor this, and I want to see what more experienced developers think of it. My objective right now is to find out when pages ...

Best way to execute a function after exactly one frame?

With ActionScript3 for Flash Player 9+, what is the nicest way to call a "once-off" function after exactly one frame? I am aware of the Timer class and it's uses, and the callLater method on Flex UIComponents (which, glancing through the source, doesn't look very efficient in this scenario). I'm also aware of setTimeout (in flash.utils)...