Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / performance-tests / Protocols / toggle_link.pl
blobae2af9b46ca241263dbab0da2b7073bd1924618e
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use Time::localtime;
8 use Time::Local;
10 # amount of delay between running the servers
11 $sleeptime = 2;
12 $phasetime = 3;
14 $project = "pces/sctp";
16 $L1_DOWN = "tevc -e $project now link1 down &";
17 $L1_UP = "tevc -e $project now link1 up &";
18 $L2_DOWN = "tevc -e $project now link2 down &";
19 $L2_UP = "tevc -e $project now link2 up &";
21 $now = localtime;
22 $start_seconds = timelocal ($now->sec, $now->min, $now->hour, $now->mday, $now->mon, $now->year);
24 print_with_time ("L1 UP");
25 system ($L1_UP);
27 print_with_time ("L2 DOWN");
28 system ($L2_DOWN);
30 select undef, undef, undef, $phasetime;
32 for (;;)
34 print_with_time ("L2 UP");
36 system ($L2_UP);
38 select undef, undef, undef, $sleeptime / 2;
40 print_with_time ("L1 DOWN");
42 system ($L1_DOWN);
44 select undef, undef, undef, $sleeptime;
46 print_with_time ("L1 UP");
48 system ($L1_UP);
50 select undef, undef, undef, $sleeptime / 2;
52 print_with_time ("L2 Down");
54 system ($L2_DOWN);
56 select undef, undef, undef, $sleeptime;
59 sub print_with_time
61 $now = localtime;
62 $now_seconds = timelocal ($now->sec, $now->min, $now->hour, $now->mday, $now->mon, $now->year);
64 print "@_ at ", $now_seconds - $start_seconds, "\n";