ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting the system clock with excel (https://www.excelbanter.com/excel-programming/273737-setting-system-clock-excel.html)

ccdubs

Setting the system clock with excel
 
Hi,

I run a macro in an infinite loop for logging purposes. The problem is that
this seems to slow down the system clock.

One of the variables I am logging is a reference to time set on an external
device. Is it possible to use this to reset the system clock periodically?

Many thanks.



Myrna Larson[_2_]

Setting the system clock with excel
 
Check out the Date and Time *statements* in VBA Help.

On Thu, 7 Aug 2003 08:52:56 +1200, "ccdubs" wrote:

Hi,

I run a macro in an infinite loop for logging purposes. The problem is that
this seems to slow down the system clock.

One of the variables I am logging is a reference to time set on an external
device. Is it possible to use this to reset the system clock periodically?

Many thanks.



Guido[_2_]

Setting the system clock with excel
 
what about using the OnTime event rather than an infinite loop?

Guido

HoloGuides
http://hologuides.com/programming/ExcelVBA


"jaf" schrieb im Newsbeitrag
...
Hi,
Running a macro in an infinite loop will slow the system clock because
Windows isn't getting enough CPU cycles.
Do you use DoEvents in your loop?


--

John

johnf202 at hotmail dot com


"ccdubs" wrote in message
...
Tom,

The system clock only slows down when the macro is running, otherwise it
remains fairly accurate.

I too was surprised at this and as yet I am unable to explain it.

All the macro does is write data to a text file and would be easy enough

to
simulate if you are interested in trying it overnight on your own

computer.


"Tom Ogilvy" wrote in message
...
You really think his code may be slowing down the system clock?

Regards,
Tom Ogilvy


Myrna Larson wrote in message
...
Check out the Date and Time *statements* in VBA Help.

On Thu, 7 Aug 2003 08:52:56 +1200, "ccdubs"

wrote:

Hi,

I run a macro in an infinite loop for logging purposes. The

problem
is
that
this seems to slow down the system clock.

One of the variables I am logging is a reference to time set on an
external
device. Is it possible to use this to reset the system clock
periodically?

Many thanks.











ccdubs

Setting the system clock with excel
 
The "catch 22" is that I want as many cycles as possible and an accurate
time stamp.

I think I have resolved the issue (thanks to you all). The device that I am
reading data from has its own clock and I am using that clock as my time
stamp and I will also use it every hour or so to reset the system clock.
Just to keep things tidy.

Many thanks.

"Guido" wrote in message
...
what about using the OnTime event rather than an infinite loop?

Guido

HoloGuides
http://hologuides.com/programming/ExcelVBA


"jaf" schrieb im Newsbeitrag
...
Hi,
Running a macro in an infinite loop will slow the system clock because
Windows isn't getting enough CPU cycles.
Do you use DoEvents in your loop?


--

John

johnf202 at hotmail dot com


"ccdubs" wrote in message
...
Tom,

The system clock only slows down when the macro is running, otherwise

it
remains fairly accurate.

I too was surprised at this and as yet I am unable to explain it.

All the macro does is write data to a text file and would be easy

enough
to
simulate if you are interested in trying it overnight on your own

computer.


"Tom Ogilvy" wrote in message
...
You really think his code may be slowing down the system clock?

Regards,
Tom Ogilvy


Myrna Larson wrote in message
...
Check out the Date and Time *statements* in VBA Help.

On Thu, 7 Aug 2003 08:52:56 +1200, "ccdubs"

wrote:

Hi,

I run a macro in an infinite loop for logging purposes. The

problem
is
that
this seems to slow down the system clock.

One of the variables I am logging is a reference to time set on

an
external
device. Is it possible to use this to reset the system clock
periodically?

Many thanks.














All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com