Sending periodic signals in tunnel.py

Hi all,

Memory: 1008.6MiB
CPU: Processor 0: 2.8GHz and Processor 1:2.8GHz
OS: 2.6.27.23-78.2.50.fc.i686 (Fedora 9)
GNU Radio: neither 3.1.3 nor 3.2. (I
download the gnuradio in the trunk several months ago.)

I have two machines, A and B ( the same systems as shown above).
I would like to send out signals periodically
(every 4.5ms) from A to B in the MAClayer of the tunnel.py in the
gnuradio-examples folder. I
implemented this idea after the “while 1” in the “main_loop” for MAC. It
took a while (a
few hundreds millisecond) to repeat the loop. I think that Python might
be too
slow to be implemented the periodic signals so that the tunnel.py could
not send
the signal every 4.5ms. Right? Can anyone give me some hints to let me
know if
I can send out the signal every 4.5ms in tunnel.py? I would really
appreciate any suggestions…

Thank you,
Jane

Codes
in tunnel.py:
while 1:
now=datetime.datetime.now()
now_second=now.second
now_usecond=now.microsecond
now_time=(now_second)*1000000+now.microsecond
print “While_1 now_time =
%d” % (now_time)
# send out a packet to a client here

Results
of Print:
While_1 now_time = 20754893 microsecond
While_1 now_time = 20755001
While_1 now_time = 20951609
While_1 now_time = 20952030
While_1 now_time = 20979402
While_1 now_time = 20979804
While_1 now_time = 21202578
While_1 now_time = 21453420
While_1 now_time = 21486651
While_1 now_time = 21653691
While_1 now_time = 22124831
While_1 now_time = 22284597
While_1 now_time = 22485948
While_1 now_time = 22682929
While_1 now_time = 22683291
While_1 now_time = 22800091

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs