Click here to Skip to main content
16,015,097 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Free software for UI Designing Pin
Christian Graus14-Jun-05 23:43
protectorChristian Graus14-Jun-05 23:43 
GeneralRe: Free software for UI Designing Pin
misspoo2215-Jun-05 0:23
misspoo2215-Jun-05 0:23 
GeneralRe: Free software for UI Designing Pin
Christian Graus15-Jun-05 13:02
protectorChristian Graus15-Jun-05 13:02 
GeneralCapture keystroke Pin
Anonymous14-Jun-05 0:11
Anonymous14-Jun-05 0:11 
GeneralRe: Capture keystroke Pin
Christian Graus14-Jun-05 1:40
protectorChristian Graus14-Jun-05 1:40 
GeneralRe: Capture keystroke Pin
Anonymous14-Jun-05 17:02
Anonymous14-Jun-05 17:02 
GeneralRe: Capture keystroke Pin
Christian Graus14-Jun-05 17:04
protectorChristian Graus14-Jun-05 17:04 
GeneralExecution time of code. Pin
Alsvha13-Jun-05 20:36
Alsvha13-Jun-05 20:36 
Hiya all, I'm unsure whether to place the question here or in asp.net, but opted for here seeing as I use VB.Net as codebehind.

I'm trying to meassure how long time two differnet segments of code uses to excute, approximately - it is only for comparing and personal interest.
However - I end up with results which I just can't seem to accept as being correct.

What I do is use "ticks" at start and end and subtract the two, thinking this would give me the time in ticks between the two... like this:

dim longStart, longEnd as long
dim doubleDiff as double
 doubleDiff = 0
 longStart = DateTime.Now.Ticks
 For intCounter As Integer = 0 To 24999
      //code to perform.
 Next
 longEnd  = DateTime.Now.Ticks
 doubleDiff = longEnd  - longStart 
 doubleDiff = doubleDiff / TimeSpan.TicksPerMillisecond
     
 longStart = DateTime.Now.Ticks
 For intCounter As Integer = 0 To 24999
      //some other code to perform.
 Next
 longEnd  = DateTime.Now.Ticks
 doubleDiff = longEnd  - longStart 
 doubleDiff = doubleDiff / TimeSpan.TicksPerMillisecond



However - this presents me with some odd result. Sometimes the former code segment displays as 0. Sometimes the second codesegment presents as one number and sometimes as that number plus what the first codesegment has displayed as.

So if I for instance get 15.12 as result for segment one, then I will often get X or X+15.12 for the second segment on subsequent runs. X often also is the result of first segment of code multipled with 10 which leads me for sure to belive something is going on which shouldn't be.

I am doing something terrible wrong, but I don't know what - it should be pretty straight forward...
Anybody got some advice for me, or can smack me on the head so I find out what is wrong Smile | :)

---------------------------
127.0.0.1 - Sweet 127.0.0.1
GeneralRe: Execution time of code. Pin
Dave Kreskowiak14-Jun-05 1:50
mveDave Kreskowiak14-Jun-05 1:50 
GeneralNeed A code run with active directory Pin
y_mmohd13-Jun-05 18:42
y_mmohd13-Jun-05 18:42 
GeneralRe: Need A code run with active directory Pin
Dave Kreskowiak14-Jun-05 4:29
mveDave Kreskowiak14-Jun-05 4:29 
GeneralRe: Need A code run with active directory Pin
Anonymous14-Jun-05 4:52
Anonymous14-Jun-05 4:52 
GeneralRe: Need A code run with active directory Pin
Dave Kreskowiak14-Jun-05 2:31
mveDave Kreskowiak14-Jun-05 2:31 
GeneralOutlook Calendar Information Pin
KaptinKrunch13-Jun-05 14:22
KaptinKrunch13-Jun-05 14:22 
Questionhow to compare the text of two html pages Pin
Mohsen Saad13-Jun-05 14:22
Mohsen Saad13-Jun-05 14:22 
AnswerRe: how to compare the text of two html pages Pin
Christian Graus13-Jun-05 14:25
protectorChristian Graus13-Jun-05 14:25 
GeneralRe: how to compare the text of two html pages Pin
Mohsen Saad14-Jun-05 8:15
Mohsen Saad14-Jun-05 8:15 
GeneralRe: how to compare the text of two html pages Pin
Christian Graus14-Jun-05 13:49
protectorChristian Graus14-Jun-05 13:49 
GeneralRe: how to compare the text of two html pages Pin
Mohsen Saad15-Jun-05 5:32
Mohsen Saad15-Jun-05 5:32 
GeneralRe: how to compare the text of two html pages Pin
Christian Graus15-Jun-05 13:09
protectorChristian Graus15-Jun-05 13:09 
GeneralMap Area to onclick event Pin
asalyon13-Jun-05 13:29
asalyon13-Jun-05 13:29 
GeneralRe: Map Area to onclick event Pin
Christian Graus13-Jun-05 14:06
protectorChristian Graus13-Jun-05 14:06 
GeneralRe: Map Area to onclick event Pin
asalyon13-Jun-05 15:21
asalyon13-Jun-05 15:21 
GeneralRe: Map Area to onclick event Pin
Christian Graus13-Jun-05 15:33
protectorChristian Graus13-Jun-05 15:33 
GeneralRe: Map Area to onclick event Pin
asalyon13-Jun-05 16:23
asalyon13-Jun-05 16:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.