Your best friend for file transfer.

Fetch application logoFetch

how does fetch calculate thoughput? (2 posts)

This is an archived topic. The information in it is likely to be out-of-date and no longer applicable to current versions of Fetch.
  • Started 12 years ago by eris
  • Latest reply 12 years ago from Jim Matthews
  • eris Member

    I'm writing an applescript to do an acceptance test on a network driver. I really need to be able to calculate throughput in bits/second or bytes/second. Assuming the "elapsed transfer time" property is in ticks (?) I've tried just about every combination of the math and still can't get a number close to the "bytes/s" listed in the transfer window.

    Is that number correct? If so, how, exactly, do I calculate it from the "elapsed transfer time" and "bytes transfered" properties?

    Thanks...

    /jen

    Posted 12 years ago #

  • Jim Matthews Administrator

    Ticks are 60ths of a second, so the following should duplicate the displayed bytes/second number:

    tell application "Fetch 4.0"
    set t to elapsed transfer time of transfer window 1
    set b to bytes transfered of transfer window 1
    set bytes_per_second to (b / (t / 60))
    end tell

    Jim Matthews
    Fetch Softworks

    Posted 12 years ago #

Topic closed

This topic has been closed.