Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: get current time with milliseconds?


From   Matthew White <[email protected]>
To   [email protected]
Subject   Re: st: get current time with milliseconds?
Date   Tue, 23 Jul 2013 10:42:51 -0400

Hi Iip,

For that use, check out -timer- and -profiler-.

Best,
Matt

On Mon, Jul 22, 2013 at 11:55 PM, iip <[email protected]> wrote:
> Hi Sergiy,
>
> Thanks a lot, very informatif.
>
> I'm going to test time performance of code repeat the code multiple
> times, so based on your info, on Stata I'm only able to do it in
> seconds right?
>
> Best,
>
> -iip-
>
> On Tue, Jul 23, 2013 at 10:35 AM, Sergiy Radyakin
> <[email protected]> wrote:
>> Hi Iip,
>>
>> First, you may want to elaborate on your particular problem you are
>> solving. Be careful because as we know: " The OS Components may
>> contain support for programs written in Java. Java technology is not
>> fault tolerant and is not designed, manufactured, or intended for use
>> or resale as on-line control equipment in hazardous environments
>> requiring fail-safe performance, such as in the operation of nuclear
>> facilities, aircraft navigation or communication systems, air traffic
>> control, direct life support machines, or weapons systems, in which
>> the failure of Java technology could lead directly to death, personal
>> injury, or severe physical or environmental damage. " (
>> http://technet.microsoft.com/en-us/library/cc976720.aspx )
>>
>> Second, read the following article:
>> http://msdn.microsoft.com/en-us/magazine/cc163996.aspx
>>
>> Now given that Stata is cross-platform, and that "timestamps ... from
>> Windows NT are limited to a maximum resolution of 10 or 15
>> milliseconds, depending on the underlying hardware" you will have a
>> decent problem to have such a precise measurement. And by that I mean
>> "current time to milliseconds", I don't mean just any time close to
>> current, with some milliseconds attached to it. Note that neither
>> Windows XP, nor Windows Server 2003, nor earlier versions of Windows
>> can't use HPET (if you count on it).
>>
>> In any case here is what you may want to explore, and more suggestions
>> will probably come from others:
>> 1) to time performance of code repeat the code multiple times, then
>> you need to measure seconds;
>> 2) to get the world time consult an online service, many are linked to
>> atomic clocks worldwide; transmission delay is usually a fraction of a
>> second (about 0.2 here) and it takes several seconds to synchronize;
>> 3) to get really precise time measurement you may want to attach a GPS
>> dongle and read time from there. that might give you up to a 40ns
>> resolution, not sure how fast your program will be able to digest it;
>> 4) to get random numbers use truernd or other similar approaches.
>>
>> Finally, Stata advertizes: "High-frequency data with millisecond
>> resolution" here: http://www.stata.com/features/time-series/
>> But I always assumed that the above refers to the ability to
>> manipulate data stored with such precise timestamps, not to generate
>> and timestamp it with such high frequency.
>>
>>
>> Best, Sergiy Radyakin
>>
>> On Mon, Jul 22, 2013 at 9:10 PM, iip <[email protected]> wrote:
>>> On Thu, Jul 18, 2013 at 12:29 PM, iip <[email protected]> wrote:
>>>> Hi All,
>>>>
>>>> I'm trying to get current time with milliseconds, using
>>>> c(current_time) only get seconds, how to get time including a
>>>> milliseconds?
>>>>
>>>> Thanks,
>>>>
>>>> -iip-
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



-- 
Matthew White
Senior Project Associate
Innovations for Poverty Action
101 Whitney Avenue, New Haven, CT 06510 USA
www.poverty-action.org
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index