[dpdk-dev] Question about specifying constant time interval when using rte_get_timer_cycles().

Bruce Richardson bruce.richardson at intel.com
Mon Oct 5 15:10:09 CEST 2015


On Mon, Oct 05, 2015 at 07:59:27PM +0900, 최익성 wrote:
> Dear DPDK experts.
>  
> I have a question about specifying constant time interval when using rte_get_timer_cycles();
>  
> Would you let me know how can I specify constant time 30 seconds of DRAIN_TIME?
>  
> I will really appreciate if let me know.
>  
>  
> uint64_t now, old, DRAIN_TIME ;
>  
> DRAIN_TIME =  ?   // 30 seconds.
>  
> old = rte_get_timer_cycles();
> ... 
> now = rte_get_timer_cycles(); 
>  
> if ((new-old) > DRAIN_TIME ) { ... } 
>  
>  
> Thank you very much.
>  
> Sincerely Yours,
>  
> Ick-Sung Choi.
> 
The companion function rte_get_timer_hz should be what you want I think. It will
allow you to translate cycles to seconds/milliseconds.

/Bruce


More information about the dev mailing list