home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / cgi-bin / timehires.pm < prev    next >
Encoding:
Text File  |  2004-05-20  |  1.9 KB  |  58 lines

  1. #!/usr/bin/perl
  2. #-----------------------------------------------------------------------------
  3. # TimeHires AWStats plugin
  4. # Change time accuracy in showsteps option from seconds to milliseconds
  5. #-----------------------------------------------------------------------------
  6. # Perl Required Modules: Time::HiRes
  7. #-----------------------------------------------------------------------------
  8. # $Revision: 1.4 $ - $Author: joker $ - $Date: 2004/05/20 20:38:42 $
  9.  
  10.  
  11. # <-----
  12. # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES
  13. if (!eval ('require "Time/HiRes.pm"')) { return $@?"Error: $@":"Error: Need Perl module Time::HiRes"; }
  14. # ----->
  15. use strict;no strict "refs";
  16.  
  17.  
  18.  
  19. #-----------------------------------------------------------------------------
  20. # PLUGIN VARIABLES
  21. #-----------------------------------------------------------------------------
  22. # <-----
  23. # ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN
  24. # AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE.
  25. my $PluginNeedAWStatsVersion="5.1";
  26. my $PluginHooksFunctions="GetTime";
  27. # ----->
  28.  
  29.  
  30.  
  31. #-----------------------------------------------------------------------------
  32. # PLUGIN FUNCTION: Init_pluginname
  33. #-----------------------------------------------------------------------------
  34. sub Init_timehires {
  35.     my $InitParams=shift;
  36.     my $checkversion=&Check_Plugin_Version($PluginNeedAWStatsVersion);
  37.  
  38.     # <-----
  39.     # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
  40.     # ----->
  41.  
  42.     return ($checkversion?$checkversion:"$PluginHooksFunctions");
  43. }
  44.  
  45.  
  46. #-----------------------------------------------------------------------------
  47. # PLUGIN FUNCTION: GetTime_pluginname
  48. # UNIQUE: YES (Only one plugin using this function can be loaded)
  49. #-----------------------------------------------------------------------------
  50. sub GetTime_timehires {
  51.     my ($sec,$msec)=Time::HiRes::gettimeofday();
  52.     $_[0]=$sec;
  53.     $_[1]=$msec;
  54. }
  55.  
  56.  
  57. 1;    # Do not remove this line
  58.