From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: Question about specifying constant time interval when using rte_get_timer_cycles(). Date: Mon, 5 Oct 2015 14:10:09 +0100 Message-ID: <20151005131008.GA22612@bricha3-MOBL3> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: =?utf-8?B?7LWc7J217ISx?= Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 739D791A9 for ; Mon, 5 Oct 2015 15:10:13 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Oct 05, 2015 at 07:59:27PM +0900, =EC=B5=9C=EC=9D=B5=EC=84=B1 wro= te: > Dear DPDK experts. > =20 > I have a question about specifying constant time interval when using rt= e_get_timer_cycles(); > =20 > Would you let me know how can I specify constant time 30 seconds of DRA= IN_TIME? > =20 > I will really appreciate if let me know. > =20 > =20 > uint64_t now, old, DRAIN_TIME ; > =20 > DRAIN_TIME =3D ? // 30 seconds. > =20 > old =3D rte_get_timer_cycles(); > ...=20 > now =3D rte_get_timer_cycles();=20 > =20 > if ((new-old) > DRAIN_TIME ) { ... }=20 > =20 > =20 > Thank you very much. > =20 > Sincerely Yours, > =20 > Ick-Sung Choi. >=20 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