[Tinyos-help] Tr : calculate Time in seconds
Michael Schippling
schip at santafe.edu
Tue May 5 10:04:59 PDT 2009
Nope, still not entirely clear (to me anyway).
In T1 there is a Clock interface, but it does not
have a clock() method. However the interface file
contains some detailed (!what a surprise!) information
about what the counts might mean...if you know how
it is setup. I also don't find a clock_t type in T1...
How is your clock() method wired?
And what platform are you using?
Also there's probably no need to use a float for the result
time as the counts are most likely some kind of int.
MS
Rannouna Rania wrote:
>
> Hi,
>
> I used :
> clock_t initial_time;
> clock_t final_time;
> float CPU_time;
> In my code ;
> initial_time= clock();
> tate(mip,P,Q,res);// I need to know the time required by this function
> final_time=clock();
> CPU_time=final_time - initial_time;
> if I display on the PC this value (CPU_time) I found 15,000 (I think
> clock ticks but I want in seconds).
> I hope that is more clear now.
> Thank you very much.
> Best Regards,
> Rania
>
> ----- Message transféré ----
> *De :* Eric Decker <cire831 at gmail.com>
> *À :* Rannouna Rania <rrannouna at yahoo.fr>
> *Cc :* tinyos-help at millennium.berkeley.edu
> *Envoyé le :* Lundi, 4 Mai 2009, 23h35mn 50s
> *Objet :* Re: [Tinyos-help] calculate Time in seconds
>
> If you are using TimerMilli or LocalTimeMilli each tick is a binary
> millisec. There are 1024 per second.
>
> Not sure from your description what you are trying to do. Can you be
> clearer?
>
> e
>
> On Mon, May 4, 2009 at 1:33 PM, Rannouna Rania <rrannouna at yahoo.fr
> <mailto:rrannouna at yahoo.fr>> wrote:
>
> Hi all,
>
> Thank you all for your Kind response and your help.
> In fact I am new in tinyos, so that sometimes I ask questions that
> seem maybe evident.
> Now my problem is that I want to calculate the time needed by my
> application in seconds.
> I succed to calculate it in clock ticks.
> Have you any idea how can I do this? I guess I should use the
> SimpleTime component but I can't understand how to use it (I am
> going to use the telosb).
> Thank you very much in advance.
> Best Regards,
> Rania
>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> <mailto:Tinyos-help at millennium.berkeley.edu>
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
> Autonomous Systems Lab
> Jack Baskin School of Engineering
> UCSC
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
More information about the Tinyos-help
mailing list