time a script

Author Message
robszar

  • Total Posts : 193
  • Scores: 0
  • Reward points : 0
  • Joined: 2/27/2005
  • Location:
  • Status: offline
time a script Monday, May 16, 2005 8:45 AM (permalink)
0
is there a way to time a script, get the time in the begining and end subtract the difference?
 
#1
    Country73

    • Total Posts : 754
    • Scores: 10
    • Reward points : 0
    • Status: offline
    Re: time a script Monday, May 16, 2005 9:27 AM (permalink)
    0
    sStart = NOW 'beginning of your script
    sFinish = NOW 'end of your script

    sTotal = sFinish - sStart
    wscript.echo sTotal
     
    #2
      didorno

      • Total Posts : 361
      • Scores: 0
      • Reward points : 0
      • Joined: 2/12/2005
      • Location:
      • Status: offline
      Re: time a script Monday, May 16, 2005 9:33 AM (permalink)
      0
      There are a lot of functions with dates and time to manipulate with
      within VBScript.
      You can use f.i. the next code at the start of the script.
      StartTime = Now
      

      At the end of the script you can use
      WScript.Echo DateDiff("s", StartTime, Now)

      where "s" gives the difference in seconds.

      Good luck !
       
      #3
        didorno

        • Total Posts : 361
        • Scores: 0
        • Reward points : 0
        • Joined: 2/12/2005
        • Location:
        • Status: offline
        Re: time a script Monday, May 16, 2005 9:41 AM (permalink)
        0
        Country73, I didn't saw your post until I sended mine.
        In your proposal I get a rather ugly difference format.
        robszar, if you like to have a difference expressed in a different unit :
        minutes : n
        hours : h
        days : d
        months : m

        Good luck !
         
        #4
          robszar

          • Total Posts : 193
          • Scores: 0
          • Reward points : 0
          • Joined: 2/27/2005
          • Location:
          • Status: offline
          Re: time a script Monday, May 16, 2005 3:40 PM (permalink)
          0
          thanks!
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9