From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by dpdk.org (Postfix) with ESMTP id 739D791A9
 for <dev@dpdk.org>; Mon,  5 Oct 2015 15:10:13 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga103.fm.intel.com with ESMTP; 05 Oct 2015 06:10:12 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.17,638,1437462000"; d="scan'208";a="784746851"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.33])
 by orsmga001.jf.intel.com with SMTP; 05 Oct 2015 06:10:10 -0700
Received: by  (sSMTP sendmail emulation); Mon, 05 Oct 2015 14:10:09 +0025
Date: Mon, 5 Oct 2015 14:10:09 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: =?utf-8?B?7LWc7J217ISx?= <pnk003@naver.com>
Message-ID: <20151005131008.GA22612@bricha3-MOBL3>
References: <a51e66f48be0a2a7bb595085a3cbadb7@cweb29.nm.nhnsystem.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a51e66f48be0a2a7bb595085a3cbadb7@cweb29.nm.nhnsystem.com>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] Question about specifying constant time interval
 when using rte_get_timer_cycles().
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 05 Oct 2015 13:10:13 -0000

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) &gt; 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