in reply to Re: sleep and timing?
in thread sleep and timing?

My objective (crazy or not) is to send N number of traps in a specific amount of time. I'm trying to do some performance testing so I'm not concerned about the destination or the arrival time at the other end.

Replies are listed 'Best First'.
Re^3: sleep and timing?
by BrowserUk (Patriarch) on Nov 23, 2005 at 16:26 UTC

    Then rather than trying to send for an exact time period and count how many you succeeded in transmitting, do it the other way around. Transmit a set number of traps and time how long it took. Set the number to send relatively high and divide that number by the number of seconds taken to arrive at an average throughput per second.

    This is a simulation.

    Although each "trap" delays at least 10 ms and an average of 30 millseconds, threading allows those delays to overlap, so the ultimate cost per trap is under 4 ms.

    HTH


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Ah...good idea. That's a much better aproach. Thanks for all your help!