File: setrandomdelay.cc

package info (click to toggle)
stealth 4.04.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,540 kB
  • sloc: cpp: 2,759; sh: 151; makefile: 111; ansic: 52
file content (17 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "options.ih"

void Options::setRandomDelay()
{ 
    string delay;

                                    // no option initializes to 0
    if (not (d_randomDelay = d_arg.option(&delay, 'i')))
        return;

    if (not d_repeat)
        fmsg << "--random-interval requires --repeat" << noidl;

    d_delayInterval = checkM(delay, "random-interval");

    srandom(time(0));               // seed the random time generator
}