From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ns.mahan.org (unknown [67.116.10.138]) by dpdk.org (Postfix) with ESMTP id 276172E89 for ; Thu, 5 Sep 2013 20:01:00 +0200 (CEST) Received: from [192.168.71.31] (localhost [127.0.0.1]) (authenticated bits=0) by ns.mahan.org (8.14.5/8.14.5) with ESMTP id r85I1UWA059667 for ; Thu, 5 Sep 2013 11:01:30 -0700 (PDT) (envelope-from mahan@mahan.org) From: Patrick Mahan Content-Type: text/plain; charset=us-ascii X-Mailer: iPad Mail (10B329) Message-Id: <16BB02EF-879C-4DB1-804E-E5E6E08B935E@mahan.org> Date: Thu, 5 Sep 2013 11:01:32 -0700 To: dev@dpdk.org Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: [dpdk-dev] Recommended method of getting timestamps? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2013 18:01:01 -0000 I have a need to keep a timestamp on a piece of global data. When then time= stamp grows too old I want to refresh that data. Is it safe to use, gettime= ofday()? I thought about using an alarm, but I need to set an alarm from inside the a= larm callback which doesn't look like it will work due to the spinlock on th= e alarm list. And since this is inside the driver I am working on, setting up a timer is n= ot simple. So, I figure to timestamp the data, wait until I need to access it, check th= e timestamp and refresh if it is too old. Thoughts? Suggestions? Thanks, Patrick Coming to you from deep inside Fortress Mahan=