Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Speed of direct link

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Speed of direct link

Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double

starttime = Time()

'your code

endtime = Time()


Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

End Sub

"Dan" wrote:

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan

  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Speed of direct link

Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()...).

"Joel" wrote:

Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double

starttime = Time()

'your code

endtime = Time()


Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

End Sub

"Dan" wrote:

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Speed of direct link

Not sure what RTGET() is. Is this a workssheet function?

If it is a worksheet function then try this

on worksheet do this
=Testtime()


in VBA
function testTime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double


Starttime = Time()
TestTime = RTGET()
EndTime = Time



starttime = Time()

'your code

endtime = Time()

Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

msgbox "exection Time is : " & MSeconds

end function

"Dan" wrote:

Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()...).

"Joel" wrote:

Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double

starttime = Time()

'your code

endtime = Time()


Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

End Sub

"Dan" wrote:

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Speed of direct link

ActiveWorkbook.SaveAs Filename:="C:\TEMP\Book1.xml", _
FileFormat:=xlXMLSpreadsheet


"Dan" wrote:

Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()...).

"Joel" wrote:

Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double

starttime = Time()

'your code

endtime = Time()


Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

End Sub

"Dan" wrote:

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan



  #6   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Speed of direct link

?

"Joel" wrote:

ActiveWorkbook.SaveAs Filename:="C:\TEMP\Book1.xml", _
FileFormat:=xlXMLSpreadsheet


"Dan" wrote:

Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()...).

"Joel" wrote:

Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double

starttime = Time()

'your code

endtime = Time()


Time_Diff = endtime - starttime

'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec

End Sub

"Dan" wrote:

Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Speed of direct link

On Apr 15, 11:24*pm, Dan wrote:
?



"Joel" wrote:
* * ActiveWorkbook.SaveAs Filename:="C:\TEMP\Book1.xml", _
* * * *FileFormat:=xlXMLSpreadsheet


"Dan" wrote:


Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()....).


"Joel" wrote:


Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double


starttime = Time()


'your code


endtime = Time()


Time_Diff = endtime - starttime


'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec


End Sub


"Dan" wrote:


Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan- Hide quoted text -


- Show quoted text -


Hi,

Sorry to say, but Dan's method won't work for you since although the
theory is sound, VBA's Time() function is only accurate to one second,
no matter how much you divide it down. The following ver similar
method however should give you the accuracy you need:

Option Explicit
Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Sub TimeDiff()
Dim StartTime As Long, elTime As Double

StartTime = timeGetTime()

'Do whatever here

elTime = (timeGetTime() - StartTime) / 1000

MsgBox "That took " & elTime & " seconds."

End Sub

If you are trying to test the speed of an Excel function, you will
have to write a UDF or something that acts as a wrapper to the
function.

Cheers,
Ivan.
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Speed of direct link

On Apr 16, 1:11*am, Ivyleaf wrote:
On Apr 15, 11:24*pm, Dan wrote:





?


"Joel" wrote:
* * ActiveWorkbook.SaveAs Filename:="C:\TEMP\Book1.xml", _
* * * *FileFormat:=xlXMLSpreadsheet


"Dan" wrote:


Thank you, but my problem is to catch the event in change in the direct feed
data - it is not coming from code but just a function (such ar RTGET()...).


"Joel" wrote:


Sub mytime()
Const MSec = 86400000
Dim MSeconds As Double
Dim Time_Diff As Double


starttime = Time()


'your code


endtime = Time()


Time_Diff = endtime - starttime


'with time, 1 equal 1 day.
'to get milliseconds
'24 * 60 * *60 * 1000
MSeconds = Time_Diff * MSec


End Sub


"Dan" wrote:


Hi,
I get data updating from two sources on the same sheet, and I am intersted
to check which on os faster - the difference will be in milliseconds. Is
there a way to do that in Excel.
Many thanks,
Dan- Hide quoted text -


- Show quoted text -


Hi,

Sorry to say, but Dan's method won't work for you since although the
theory is sound, VBA's Time() function is only accurate to one second,
no matter how much you divide it down. The following ver similar
method however should give you the accuracy you need:

Option Explicit
Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Sub TimeDiff()
* Dim StartTime As Long, elTime As Double

* StartTime = timeGetTime()

* * 'Do whatever here

* elTime = (timeGetTime() - StartTime) / 1000

* MsgBox "That took " & elTime & " seconds."

End Sub

If you are trying to test the speed of an Excel function, you will
have to write a UDF or something that acts as a wrapper to the
function.

Cheers,
Ivan.- Hide quoted text -

- Show quoted text -


Oops... sorry, I meant Joel's method. Sorry Dan.

Cheers,
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Direct to sheet Gazz_85[_2_] Excel Discussion (Misc queries) 2 July 10th 09 12:08 PM
How do I include a direct phone link to Skype in Word or Excell? Maria Excel Discussion (Misc queries) 2 February 2nd 08 09:37 PM
Can you direct me. Baha Excel Discussion (Misc queries) 3 June 22nd 07 08:56 AM
Can Excel auto-direct you to the source of a link? Amy Excel Discussion (Misc queries) 0 February 9th 05 08:07 PM
Can I get excel to auto direct me to the source of a link? jimmy995 Excel Worksheet Functions 0 February 9th 05 07:57 PM


All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"