Network statistics program
tomega at earthlink.net
Wed May 17 05:54:16 CEST 2000
The time module has a sleep function. Put time.sleep(60) at the end of a cycle
and it will wait 60 seconds before starting the cycle.
Greg Fortune wrote:
> I'm currently working on a program that will run some network statistics
> for me over the span of months. I want to send a ping every minute, collect
> the results, and then store that information in a database. I think I can
> get everything working, but the issue of the one minute interval is killing
> me. How do I make my program just sit there and do nothing until the system
> clock says it has been a minute? Never before have I *tried* to make a
> program do nothing :).
> I consider a while loop with a pass statement or a time check, but that
> seems like it would take up processor cycles for little reason.
> I also considered letting ping handle the interval and just use ping as
> the piped input. Although this may be the simplest solution for me at this
> time, I really want to learn how to implement delay.
> Any help is greatly appreciated,
> Greg Fortune
More information about the Python-list