From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-x22e.google.com (mail-ua0-x22e.google.com [IPv6:2607:f8b0:400c:c08::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 25191802AC for ; Sun, 5 Mar 2017 22:52:58 -0800 (PST) Received: by mail-ua0-x22e.google.com with SMTP id f54so157349537uaa.1 for ; Sun, 05 Mar 2017 22:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=E9GCKy/fFx6/aY54/DXTWTtEk8cYmZkCVhfpTM9ghqk=; b=Ufp0AiL/oUDDzNr8FEhkL/7uNeNgt7VEe5aRMFPhMtsCQpUM3CV3hZAKOUAV/aeZCH PIGfmFXJMTlC+ky+k+QvM6RJ/hi2kMGQSxG/81bfXVGuILyUI0AEqd8gL7/j7vQTduQn HCidv1z4k8o5M4QAK66d6aV2xaE+7iI62lBeEBNUsh/W26yIOY8OBT18GIaCp2umshSf d+gfAsE8LkFWAXO9LtlM3COLz2YzgJekF94AuR2ldaWu5GPgee0XCB3Y8oNh+wmZV/RO 1OQnycLDCk29dWJ8FUhhrCodWOOlzUBe5Wq/Oa0CiLWJkezWnAR6Ab6TVHTqEv8b7yrV lwyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=E9GCKy/fFx6/aY54/DXTWTtEk8cYmZkCVhfpTM9ghqk=; b=e6laeVcG1khFQanMTapMr8RK2l472IgC02VdqmSBIZdGsr9X3xdhSjBQgiw/EA5ZTU G189XQspfQdxHMmiv22DI+yx68VVMI9axIEo80UTfSKRdVlnRblyRI54JHfJvC/i39EZ 5MZ9kMlo39pPkQlhIEaKhj/nRb2rX8amun5fI8TUfUrKXcptFRHoYNxmp0Ofjq73ekqj +CHf6nBQKD5ska9zN3lRXHUCdcpc8d3bsbBOEDYN395znhMBZV0tv36xMbipjeBYDj57 F18AtGUXlgNTJRCmllgUDhnV4jm/ADwvb3kfsdauuQM5enP2TFk++8+thiBjGZxZlFA9 a1qA== X-Gm-Message-State: AMke39kbM2W7AMOS1cSHkFIWLjTBf6rNLj8vwXlvGiuwwSx7HXpM+iEaXyCmKOZ5OMIh875H2mjYDujPWdLdbg== X-Received: by 10.31.41.76 with SMTP id p73mr4218021vkp.94.1488783176687; Sun, 05 Mar 2017 22:52:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.151.68 with HTTP; Sun, 5 Mar 2017 22:52:56 -0800 (PST) In-Reply-To: References: From: Michael Zimmermann Date: Mon, 6 Mar 2017 07:52:56 +0100 Message-ID: To: Arka Sharma Cc: "Kinney, Michael D" , "edk2-devel@lists.01.org" Subject: Re: "[edk] Caculating time delay in milliseconds" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 06:52:58 -0000 Content-Type: text/plain; charset=UTF-8 Another way that can be very unreliable though is creating a timer event using CreateEvent and incrementing a counter inside the callback. This will not give you exact values and the results can vary greatly depending on the platform implementation and the cpu load but in theory it should be better than GetTime - at least for calculating time differences(not for absolute time). Thanks Michael On Mon, Mar 6, 2017 at 5:30 AM, Arka Sharma wrote: > Thanks Mike for the reply but EFI_TIMESTAMP_PROTOCOL is not there in > my platform. I tried to open it using gBS->LocateProtocol() and it > returned EFI_NOT_FOUND > > On Thu, Mar 2, 2017 at 11:38 PM, Kinney, Michael D > wrote: >> For UEFI Drivers/Applications there is also the EFI_TIMESTAMP_PROTOCOL >> if it is available on your platform. >> >> Mike >> >>> -----Original Message----- >>> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Michael >>> Zimmermann >>> Sent: Thursday, March 2, 2017 4:06 AM >>> To: Arka Sharma >>> Cc: edk2-devel@lists.01.org >>> Subject: Re: [edk2] "[edk] Caculating time delay in milliseconds" >>> >>> AFAIK the only way to do that is to use the platform specific TimerLib >>> like this: >>> >>> UINT64 >>> GetTimeMs ( >>> VOID >>> ) >>> { >>> return GetTimeInNanoSecond(GetPerformanceCounter()) / 1000000ULL; >>> } >>> >>> Thanks >>> Michael >>> >>> On Thu, Mar 2, 2017 at 12:53 PM, Arka Sharma wrote: >>> > gRT->GetTime() is accurate about seconds.Is there any way to calculate >>> > time difference in milliseconds ? >>> > Let's say >>> > >>> > Time1 = GetTimeMs(); >>> > >>> > // >>> > // Some tasks >>> > // >>> > >>> > Time2 = GetTimeMs(); >>> > >>> > // >>> > // Time taken >>> > // >>> > GetTimeDiff (Time1, Time2); >>> > >>> > Something like this >>> > >>> > Regards, >>> > Arka >>> > _______________________________________________ >>> > edk2-devel mailing list >>> > edk2-devel@lists.01.org >>> > https://lists.01.org/mailman/listinfo/edk2-devel >>> _______________________________________________ >>> edk2-devel mailing list >>> edk2-devel@lists.01.org >>> https://lists.01.org/mailman/listinfo/edk2-devel