[riot-users] Measuring time

Cenk Gündogan cenk.guendogan at fu-berlin.de
Wed Oct 21 10:05:02 CEST 2015


Hey Caroline,

you can use `xtimer_now()` [1] to get the current system time before the 
function call and again after the function call. Then you can calculate 
the difference. `xtimer_now()` returns an uint32_t and the unit is 
microseconds.

Best,
Cenk

[1] https://github.com/RIOT-OS/RIOT/blob/master/sys/include/xtimer.h#L75

On 21.10.2015 09:58, QUEVA Caroline 242137 wrote:
> Hi all !
>
> I am currently testing RIOT in native to create a network with nodes 
> communicating using UDP and RPL.
> I would like to measure time of specific functions but I didn't find a 
> way to do it, is there anything implemented to measure time ?
>
> Then, I plan to create this network with msp430 nodes if it's possible 
> with the new release. So, for msp430, is there a way to measure 
> execution time ?
>
> Thanks for your help,
>
>
> Caroline QUEVA
> Research Engineer at CEA-LIST
> DRT/LIST/DACLE/LIALP
> Laboratoire Infrastructures et Ateliers pour le Logiciel sur Puces
>
> Commissariat à l’énergie atomique et aux énergies alternatives
> MINATEC Campus | 17 rue des Martyrs | 38054 Grenoble Cedex 9
>
>
> _______________________________________________
> users mailing list
> users at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/users/attachments/20151021/3e945ef1/attachment.html>


More information about the users mailing list