discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Interesting observation regarding varying time du


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Interesting observation regarding varying time duration it takes to execute fg.start() [a flowgraph start ala thread spawning??]
Date: Sun, 7 Mar 2010 12:15:44 -0800
User-agent: Mutt/1.5.20 (2009-08-17)

On Sun, Mar 07, 2010 at 02:05:12PM -0500, Bishal Thapa wrote:
> Hi,
>   I have an interesting observation to share, and I want to see if anybody
> can help me shed some light. When I measure time in python in the following
> way:
> 
> t1 = datetime.now()
> self.start()
> t2=datetime.now()
> diff = t2.microsecond - t1.microsecond
> print "Difference %d", diff
> 
> I get very different time benchmarks..it goes from 309 microseconds
> (minimum) to all the way 1 second(max). Do you know why this thread spawning
> is taking such a variety of time after flowgraph start()??

I seriously doubt it ever take 309us :-)

If you subtract two datetimes you get a timedelta.
See the docs.

  t1 = datetime.now()
  self.start()
  t2=datetime.now()
  delta = t2 - t1
  print delta

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]