you probably should also use LocalTimeMicroC for better resolution.

I don't know how that behaves in the SIM environment...

I know it works in the real world.



On Sat, Dec 7, 2013 at 3:53 AM, nivedita datta <[email protected]>wrote:

> I am trying to calculate the time taken by a function that I wrote. I am
> using the component LocalTimeMilliC to do this. I have added the
> following lines to the configuration file:
>
> *components LocalTimeMilliC;
> TestC.LocalTime -> LocalTimeMilliC;*
>
> ...and in the module section of the implementation:
>
> *uses interface LocalTime<TMilli>;*
>
> ...and in the code:
>
> *uint32_t timestamp, timestamp1;**timestamp = call LocalTime.get();
> **...
> function called here ...
> ...
> timestamp1 = call LocalTime.get();
> dbg("Boot", "Function took %f millisecs\n", (ts1 - ts) );
> *
>
> However, it always prints the value as 0.000000 millisecs. Please let me know 
> what am I doing wrong in this code or if there is a
> better method to  calculate the time taken for execution of a function.
> Thanks for your time & effort.
> Regards, Nivedita Datta
>
>
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to