Click here to Skip to main content
15,923,689 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Basic looping problem Pin
Henry Minute6-Feb-09 2:52
Henry Minute6-Feb-09 2:52 
AnswerRe: Basic looping problem Pin
Mr Oizo6-Feb-09 3:12
Mr Oizo6-Feb-09 3:12 
GeneralRe: Basic looping problem Pin
Guffa6-Feb-09 7:53
Guffa6-Feb-09 7:53 
AnswerRe: Basic looping problem Pin
nlarson116-Feb-09 8:14
nlarson116-Feb-09 8:14 
AnswerRe: Basic looping problem Pin
Guffa7-Feb-09 5:24
Guffa7-Feb-09 5:24 
GeneralRe: Basic looping problem Pin
Samir Ibrahim7-Feb-09 5:49
Samir Ibrahim7-Feb-09 5:49 
GeneralRe: Basic looping problem Pin
Guffa7-Feb-09 8:59
Guffa7-Feb-09 8:59 
GeneralRe: Basic looping problem Pin
Samir Ibrahim10-Feb-09 2:41
Samir Ibrahim10-Feb-09 2:41 
Hi,
Sorry for getting late to answer, I was in vacation.

Guffa wrote:
The value returned from Now changes, so it could for example be 2008-12-31 23:59:59 when you call it the first time and 2009-01-01 00:00:00 the next.


That is a clever remark from your side, but my answer is "No Comment" because there is to many variables required which is necessary to use the new or old "Now" Value.

Guffa wrote:
You don't need another function that in the end just calls the method in the Integer class anyway.


I had make some tests.
-As you said above, thet CStr is a wrapping function to .net ToString function. and from my test result, that is not true.
-I had made a 2 loop


Dim TimeStart, TimeElapse
TimeStart = Now.TimeOfDay  
For I = 1 to 10000000
     strTemp = CStr(I)
Next I
TimeElapse = Now.TimeOfDay - TimeStart
MessageBox.Show(TimeElapse)


TimeStart = Now.TimeOfDay 
For I = 1 to 10000000
    strTemp = I.ToString
Next I
TimeElapse = Now.TimeOfDay - TimeStart        
MessageBox.Show(TimeElapse)


- I compare the execution time of both codes
- The result was they are in the same speed until counter "I" is over 1000000 when I is over, CStr is 17 to 30% faster than .ToString

Can you confirm?

if that so, then CStr is a VB Function and not in .net framework?

TIA

Samir R. Ibrahim

GeneralRe: Basic looping problem Pin
Guffa10-Feb-09 6:43
Guffa10-Feb-09 6:43 
GeneralRe: Basic looping problem Pin
Samir Ibrahim10-Feb-09 7:31
Samir Ibrahim10-Feb-09 7:31 
QuestionGroupbox problem Pin
cstrader2326-Feb-09 2:20
cstrader2326-Feb-09 2:20 
AnswerRe: Groupbox problem Pin
JoeSharp6-Feb-09 2:42
JoeSharp6-Feb-09 2:42 
GeneralRe: Groupbox problem Pin
cstrader2326-Feb-09 3:13
cstrader2326-Feb-09 3:13 
GeneralRe: Groupbox problem [modified] Pin
Rekless3-Jan-10 14:00
Rekless3-Jan-10 14:00 
Questionworking with Crystal Report with VB 6 Pin
jayachandra.c6-Feb-09 2:14
jayachandra.c6-Feb-09 2:14 
Questionfile recovery Pin
cst_kvp6-Feb-09 1:52
cst_kvp6-Feb-09 1:52 
AnswerRe: file recovery Pin
EliottA6-Feb-09 2:45
EliottA6-Feb-09 2:45 
GeneralRe: file recovery Pin
Luc Pattyn6-Feb-09 9:30
sitebuilderLuc Pattyn6-Feb-09 9:30 
AnswerRe: file recovery Pin
Dave Kreskowiak6-Feb-09 3:43
mveDave Kreskowiak6-Feb-09 3:43 
AnswerRe: file recovery Pin
0x3c06-Feb-09 8:17
0x3c06-Feb-09 8:17 
QuestionDataGridView selection back color problem Pin
Jay Royall5-Feb-09 23:44
Jay Royall5-Feb-09 23:44 
GeneralGenerating codes for fingerprint security door using VB.Net Pin
awoyale5-Feb-09 22:21
awoyale5-Feb-09 22:21 
GeneralRe: Generating codes for fingerprint security door using VB.Net Pin
Smithers-Jones6-Feb-09 0:24
Smithers-Jones6-Feb-09 0:24 
QuestionCombo Box Frustration Pin
shoorrock5-Feb-09 18:43
shoorrock5-Feb-09 18:43 
AnswerRe: Combo Box Frustration Pin
Christian Graus5-Feb-09 22:06
protectorChristian Graus5-Feb-09 22:06 

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.