Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Calculate microseconds (2000)

    I have entered a challenge from a work colleague. The challenge is to create an Excel application that will create a mathematical series of numbers. The winner is the person who can create the series in the quickest time. I think I am the absolute winner but want to rub it in a little <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15> The problem is I can calculate it in under a second.

    At the beginning of the code a place Now() in cell B1 and when it completes I place Now() in C1. I would like to calculate the difference in 10th, 100ths and 1000ths if possible. I want 0.001 seconds (or however long it took) in D1. Can it be done?
    Jerry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calculate microseconds (2000)

    Now() returns the time to hundredths of seconds, if you format it as hh:mm:ss.000, you'll see that the 3rd decimal is always 0.

    You can calculate the difference in seconds as =86400*(C1-B1), and format it as 0.00. Dates and times are stored with 1 day as unit; 86400 is the number of seconds in a day (24*60*60).

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Calculate microseconds (2000)

    Excellent, that is Perfect <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17>That may give you a clue to what I was calculating
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •