473,382 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Application run timing in C#

How do I time my code? I can't find the old clock() routine.

Ray
Feb 3 '07 #1
2 2778
I don't know in which version of C# you were using "the old clock() routine"
but it must've been a very ancient one :-)

Try the System.Diagnostics.Stopwatch class (if you are using .NET 2.0) or
plain DateTime start = DateTime.Now; long timeElapsed =
start.Subtract(DateTime.Now).TotalMilliseconds; or QueryPerformanceCounter
from WinAPI, depending on your needs for timing resolution.

"rayreeves re****@verizon.net>" <ray<mondwrote in message
news:EC2xh.991$xu4.286@trndny04...
How do I time my code? I can't find the old clock() routine.

Ray


Feb 3 '07 #2
Much obliged, that does it.
clock() is still reachable from C++.

Ray
>I don't know in which version of C# you were using "the old clock()
routine" but it must've been a very ancient one :-)

Try the System.Diagnostics.Stopwatch class (if you are using .NET 2.0) or
plain DateTime start = DateTime.Now; long timeElapsed =
start.Subtract(DateTime.Now).TotalMilliseconds; or QueryPerformanceCounter
from WinAPI, depending on your needs for timing resolution.

Feb 3 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: MrLr | last post by:
Greetings, I have an ASP web application that is written in VBScript, uses MS Access 2000 for record storage, and is running on a Windows 2000 Professional SP4 computer with IIS 5. The...
1
by: jj | last post by:
I've got one database server that works fine when transferring large amounts of data, but a new one that has been setup seems to want to timeout or drop the connection after a period of time. I've...
10
by: Greg Stark | last post by:
This query is odd, it seems to be taking over a second according to my log_duration logs and according to psql's \timing numbers. However explain analyze says it's running in about a third of a...
7
by: jamie | last post by:
hey all, I am attempting to do motion control for a final project, but I have a concern.... For motion control, timing is everyting, the better it is, the better it works. Currently I am...
1
by: Novice | last post by:
Hi all, I'm at my wit's end on trying to insert some timing code into the server side code that parses the hashed data contained in the hidden field being submitted to the server I've tried...
8
by: enahar | last post by:
Hi, How to timing out the asp.net web application when not in use for 15 minutes although I am using the code in web.config file as below: <authentication mode="Forms"> <forms...
11
by: Jason | last post by:
Hi I have a "problem" i have got a ASP.NET application. in this application i have included logging. in the logging i have logged how many seconds it takes for this application to fully load....
2
by: Steven D'Aprano | last post by:
The timeit module is ideal for measuring small code snippets; I want to measure large function objects. Because the timeit module takes the code snippet argument as a string, it is quite handy...
4
by: =?Utf-8?B?a3RwbW01?= | last post by:
I've got a basic system tray application running now. The primary focus of this application will be to get data from a remote db, and display it to the user. Iam a newbie in the Windows programming...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.