- improve output layout

- show running time
This commit is contained in:
Ward Wouts 2003-04-28 21:52:48 +00:00
parent 7cc5c45888
commit 3956313a4c

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w #!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.57 2003/04/28 11:02:15 ward Exp $ # $Dwarf: ripnews.rb,v 1.58 2003/04/28 20:28:05 ward Exp $
# $Source$ # $Source$
require 'date' require 'date'
@ -401,7 +401,8 @@ check_config
@maxfilelength = get_max_file_length(@config[@config.keys[0]]["TEMPDIR"]) @maxfilelength = get_max_file_length(@config[@config.keys[0]]["TEMPDIR"])
print "\n$Id$\n" print "\n$Id$\n"
print "Starting: #{Time.now}\n\n" tstart = Time.now
print "Starting: #{tstart}\n"
if Debuglevel > 2 if Debuglevel > 2
@config.each_key{|i| @config.each_key{|i|
@ -413,7 +414,7 @@ if Debuglevel > 2
end end
for group in @config.keys.sort for group in @config.keys.sort
print "Getting articles for #{group}\n" print "\nGetting articles for #{group}\n"
@articles = Article.new(@config[group]["NNTPSERVER"], group, @config[group]["NEWSRCNAME"]) @articles = Article.new(@config[group]["NNTPSERVER"], group, @config[group]["NEWSRCNAME"])
# begin # begin
@articles.get_articles(@config[group]["CACHEDIR"]) @articles.get_articles(@config[group]["CACHEDIR"])
@ -462,4 +463,12 @@ for group in @config.keys.sort
end end
@articles.quit @articles.quit
end end
print "\nFinished: #{Time.now}\n"
tend = Time.now
print "\nFinished: #{tend}\n"
runtime = (tend - tstart).to_i
h=runtime/3600
m=runtime%3600
s=m%60
m=m/60
printf("Running time: %02d:%02d:%02d\n", h, m, s)