473,320 Members | 1,858 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,320 software developers and data experts.

What is the best possible resolution that C# timing tests can get? milliseconds? nanoseconds?

DR
What is the best possible resolution that C# timing tests can get?
milliseconds? nanoseconds?
Oct 27 '07 #1
2 1264
On Oct 26, 7:16 pm, "DR" <softwareengineer98...@yahoo.comwrote:
What is the best possible resolution that C# timing tests can get?
milliseconds? nanoseconds?
Well, I'm not sure what C# has to do with it - especially since this
is a VB.NET group.... But, probably the best class to use for timing
code and such is System.Diagnostics.StopWatch. I believe this class
wraps QueryPerformanceFrequency and QueryPerformanceCounter API's -
which on most hardware should give millisecond resolution.

--
Tom Shelton

Oct 27 '07 #2
However,

As addition to Tom, has to be done more times on Windows Operating systemst,
because there is mostly a lot of processing in the background, even if you
did not start that yourself.

Therefore the results are very insecure even in milliseconds.

Cor

Oct 27 '07 #3

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

Similar topics

226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
9
by: gregg | last post by:
Hi, I have to record the execution time of a program, but in milliseconds (the target language of the project initially was Pascal, but I talked the boss into letting me code it in C). So...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
23
by: EOS | last post by:
Hi, As the title indicated, does anyone know the equivalent of GetTickCount() function in C/C++ for C#? The function is supposed to return time elapsed since the computer/device is booted in...
3
by: eladla | last post by:
Hi all, I have a function in C++/CLI that calls a native C++ function. I want the C++/CLI function to measure the time between the call to the unmanaged function and the return to the managed...
25
by: GY2 | last post by:
I writing some documentation and I want to describe a common code structure which is used to step through all the items in a collection (e.g. each file in a subdirectory) while applying more and...
5
by: =?Utf-8?B?dWxpbGxpbGxpYQ==?= | last post by:
I've had two issues plaguing me for 4 months now and I haven't gotten anywhere. I'm into making 2D games and these things are essential to games. These are my issues: 1. I need timing precise...
4
by: DR | last post by:
What is the best possible resolution that C# timing tests can get? milliseconds? nanoseconds?
9
by: Aaron Watters | last post by:
....is to forget they are sorted??? While trying to optimize some NUCULAR libraries I discovered that the best way to merge 2 sorted lists together into a new sorted list is to just append them...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.