Retrieve Computer time in microsecond

to retrieve computer time i use the function System.currentTimeMillis() but i need the time in microsecond. how could i get that?

<snip>
Java 1.5 added nanosecond methods for hardware/OS
combinations that can support it.Which at current includes none at all :)<snip>
Are you saying that System.nanoTime() isn't supported at the present time?
That's not correct - I am running a 3 GB Pentium 4, a relatively recent GigaByte m/b and XP Pro, and get very good microsecond and submicrosecond results from the method.
I executed 2 consecutuive calls to the method, like so
startTime = System.nanoTime();
estimatedTime = System.nanoTime() - startTime;and averaged 100 repetitions.
Results vary with the manner in which the jvm is executed. Here's a summary of results, to give a feel for what's possible.
Program Execution From        Nanoseconds (average)
Commandline                     1300
CrimsonEditor                    500
jEdit                            700
NetBeans IDE 4.1                1050So, depending on the method of execution, nanosecond precision ranges from 500 to 1300 (0.5 microsecond to 1.3 microsecond). Accuracy (repeatability) is not as good - there are outliers in the individual times, probably due to Garbage Collections. However excluding those outliers, times appear reasonably repeatable.

Similar Messages

  • Does Time Capsule back up everything on my computer? If I inadvertently delete photos from iPhoto can they be retrieved from Time Capsule?

    Does Time Capsule back up everything on my computer? If I inadvertently delete photos from iPhoto can they be retrieved from Time Capsule?

    About TM "Backup Drive is Full"
    Alert TM only deletes older files if they have been deleted from the source and when TM needs space on the backup drive for a new incremental backup. Time Machine "thins" it's backups; hourly backups over 24 hours old, except the first of the day; those "daily" backups over 30 days old, except the first of the week. The weeklies are kept as long as there's room.
    So, how long a backup file remains depends on how long it was on your Mac before being deleted, assuming you do at least one backup per day. If it was there for at least 24 hours, it will be kept for at least a month. If it was there for at least a week, it will be kept as long as there's room.
    Note, that on a Time Capsule the sparsebundle grows in size as needed, but doesn't shrink. Thus, from the user's view of the TC it appears that no space has been freed, although there may be space in the sparsebundle.
    Once TM has found it cannot free up enough space for a new backup it reports the disk is full. You can either erase the backup drive and start your backups anew or replace the drive with a larger drive.
    Also, see Pondini's Time Machine FAQ

  • HT4962 Any ideas how to get my software updated on my IPOD 3rd Generation when my computer times out?  I have tried several times and it appears to take 30 plus hours. How Frustrating, not to mention the kids are too!

    Any ideas how to get my software updated on my IPOD 3rd Generation when my computer times out?  I have tried several times and it appears to take 30 plus hours. How Frustrating, not to mention the kids are too!

    If the iTunes purchases are not in your iTunes library you can redownload them by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    If you restore from backup, not that synced media like apps and music are not included in the backup and thus if those items are not in the iTunes library they can't be restored to the iPod during the latter part of the restore process.

  • How can I get the time in Microsecond with JNI ?

    How can I get the time in Microsecond with JNI ?

    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lFrequency;
         ::QueryPerformanceFrequency(&lFrequency);
         return (jdouble)lFrequency.QuadPart;
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj) {
         LARGE_INTEGER lpCounter;
         ::QueryPerformanceCounter(&lpCounter);
         return (jdouble)lpCounter.QuadPart;

  • Current time in microseconds

    For one of my programs i want to find the current time in microseconds. How do i get this in Java?

    The server makes the OS calls that hook into the system processor cycle count,....
    Java doesn't directly provide this functionality.Which brings up an interesting question/point (I think).
    Since Java provides an sql.TimeStamp class to map to an sql database supporting nanos, how does Java instantiate this class as far as nanos are concerned? Unless the only thing its good for is for READING sql TIMESTAMP values.
    My understanding of this is important as it can impact my db design. I would rather have my ejb's create this data in the j2ee server, when doing sql INSERT's, rather than having the db itself do the TIMESTAMP with a trigger (for a variety of reasons, including cache maintenance). But if the nanos are all zero(!)...well, need to use a trigger.
    Thanks
    -nat

  • HT201250 is there any way to retrieve deleted time machine backups?

    is there any way to retrieve deleted time machine backups? it has now deleted the oldest, but most important backup. It was made right before before upgrading to mountain lion. Because I had some issues with placing the files back the way I wanted, I had to connect my hard drive to my mac several times. Result, everytime I did so, a backup was made. Like today, when I was transferring everything from that specific backup. But in the meantime Time Machine made a new backup, deleting the old one I was using.  Ironically, I lost everything while I was transferring the files back to my mac. Please give me good news.

    Once the external hard drive that you use for Time machine deleted its oldest backup and overwrote it, the ability to retrieve those files disappeared.  They are gone for good.
    Hope this helps

  • How can I retrieve/compute an X509 certificate's thumbprint in Python and then use it for accessing Service Management APIs from Python SDK?

    Hello,
    I am using Azure Python SDK to perform calls to ServiceManagement APIs.
    I have a .publishsettings file generated for my account which includes an encoded version of my X509 certificate and all of my subscription IDs.
    How can I retrieve/compute an X509 certificate's thumbprint in Python?
    Following is the code snippet that helps us do it in .Net.
    Is there a similar approach to do it in Python?
    var publishSettingsFile = @"C:\temp\CORP DPE Account-11-16-2011-credentials.publishsettings";
    XDocument xdoc = XDocument.Load(publishSettingsFile);
    var managementCertbase64string = xdoc.Descendants("PublishProfile").Single().Attribute("ManagementCertificate").Value;
    var importedCert = new X509Certificate2(Convert.FromBase64String(managementCertbase64string));
    thumbprint = importedCert.Thumbprint;
    Once I have the thumbprint, how can I use that thumbprint to access Service Management APIs from Python SDK?
    Thank you in Advance!
    Regards,
    Vaibhav Kale

    Hi,
    Please have check on the below article and check if it helps.
    http://azure.microsoft.com/en-in/documentation/articles/cloud-services-python-how-to-use-service-management/
    Regards,
    Mekh.

  • Entourage: "Event and computer time zones do not match."

    Since installing the latest update to the Mac OS (10.4.6) I have a glitch with Entourage (Office 2004 for Mac v. 11.2.3) and I believe it has something to do with the Mac OS. See below for explanation:
    When adding a new calendar event to the calendar, I get an error which reads:
    "Event and computer time zones do not match. In Calendar views, the event time is adjusted to display correctly." This is not true. I've checked the time zones in both my OS and Entourage and that is not the problem.
    It must have to do with how it interacts with the latest update of the Mac OS. I had not updated software on my laptop for a while, and it did not exhibit this error, so as a test, I downloaded and installed the latest version of Office and tested Entourage: no error message. To be sure, I restarted the computer and tried again: no error. Then I downloaded and installed all of the latest updates to the Mac OS using Software Update: I got the error. So, I think the problem is the interaction between the latest update of Office 2004 for Mac and the latest Mac OS or maybe even just something in the Mac OS.
    There are plenty of people complaining about this on the newsgroups at Mactopia. I'm not sure who needs to repair this problem - Apple or Microsoft, but does anyone know if there will be a patch issued by Microsoft to fix the problem? Or maybe my assessment is wrong and you have another solution?
    Thanks very much for your help with this problem.
    Dual G5 2.0 and Powerbook titanium   Mac OS X (10.4.6)  

    I am in Ohio (eastern time) and I am also having this problem. It is not annoying but my problem is I am not able to schedule any meeting on Entourage. (It will not show if the person I am inviting is busy or not). They use the Exchange server in my company, and I read on the microsoft site that public folders and hence the calendar items are not synced. But seems like this page is for Office X and not 2004. Any clues? Is the time error related to me not able to schedule meetings? I am using latest 10.4 and Entourage 2004.
    http://www.microsoft.com/mac/resources/resources.aspx?pid=resourcekits&rk=office x&article=/mac/officex/ork/KnownIssuesEntourage.xml
    MacBook Pro, iMac G4   Mac OS X (10.4.7)   2 GHz, 2G RAM

  • Getting time in microseconds

    With the class java.lang.System you can have time in milli seconds via the function getTimeMillis().
    I should be very helpfull to have another function like this getTimeMicros() that returns time in microseconds.
    Because in some tests I made I did not have enough precision with time in milliseconds. So I hope for the JDK 1.5.1 this function will be created.
    Thanks a lot.

    I was requesting precision in microseconds but I was
    not expecting to have it in nanos ! It's wonderlfull
    It could not be more precise anymore !Well, this makes sense only if the underlying OS
    supports it. Don't expect nanosecond accuracy unless
    you actually test it on the platform you're going to
    run it on.Moreover it might not be 1 nano either. Just as millis are not necessarily 1 milli.

  • I have a Mac Book and purchased a Bose system that uses an antenna to play music from the the laptop - it works great, but the computer times out and shuts down - Help

    have a Mac Book and purchased a Bose system that uses an antenna to play music from the the laptop - it works great, but the computer times out and shuts down - Help

    Check in "System Preferences">"Energy Saver" to see if you have the "Computer Sleep" bar set too low.

  • How do you download is07 I tried to do the update but my computer times out

    How do you download is07 I tried to do the update but my computer times out

    If you are getting a network timeout then try temporarily turning off all your firewall and antivirus software on your computer until the download has completed.
    Before starting the actual update you should force a backup of the iPad via File > Devices > Back Up, and preferably copy any important documents, photos, files etc off the iPad so that you have copies of them outside of the backup.

  • Entourage- Event And Computer time zones do not match. Please Help

    Event and computer time zones do not match. In calendar views,the event time is adjusted to display correctly.
    Whenever I set up a appointment I put it in at one time and it show up as another.
    PleaseHelp

    I am in Ohio (eastern time) and I am also having this problem. It is not annoying but my problem is I am not able to schedule any meeting on Entourage. (It will not show if the person I am inviting is busy or not). They use the Exchange server in my company, and I read on the microsoft site that public folders and hence the calendar items are not synced. But seems like this page is for Office X and not 2004. Any clues? Is the time error related to me not able to schedule meetings? I am using latest 10.4 and Entourage 2004.
    http://www.microsoft.com/mac/resources/resources.aspx?pid=resourcekits&rk=office x&article=/mac/officex/ork/KnownIssuesEntourage.xml
    MacBook Pro, iMac G4   Mac OS X (10.4.7)   2 GHz, 2G RAM

  • Synchronise loop with computer time

    I would like to run a while loop exactly every 1 minute, with the minute occuring as per the computer time at 0 seconds.
    a timed loop runs a minute after the loop is started and is not syncronised with the 0 seconds of the computer time.
    how do I achieve this? I realise the first loop will be less than 1 minute due to the synchonisation.
    Solved!
    Go to Solution.

    Technically there's a miniscule change you can miss a minute by this approach. As the windows timer isn't perfect and due to the multitasking the 1000ms wait can be a couple ms longer in some cases (not all the time). If this happens you could end up with the ms timer reading just before and after the '0'-second.
    (It's basically the Nyquist theorem applied on these timings)
    The solution is simple, check at a time that cant miss, e.g. 750ms.
    If checking <500ms you'll have to handle the case of 2-3 hits during the same second.
    A common solution is to store and compare to last used time, and when >=1min has passed, do action, set new last time.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Computer time right, applications 4 hours fast

    Hi,
    This one has been boggling me for awhile.
    System prefs show correct time, including time zone. But my email client, Postbox, has all mail stamped four hours into the future. In addition my Fitbit dashboard in Chrome and Safari think it's four hours later.
    In searching for a solution, I've run across this page: If the wrong date or time is displayed in some apps on your Mac - Apple Support  which suggests the problem may result from a custom time format setting. However, I have no custom settings.
    I've also tried resetting the NVRAM, though I doubted this would work, as the computer time is correct.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • Computing time

    hi all,
    How to compute time for running program. what I mean is how long the program running.

    Unix systems (including Linux) provide the command "time" which does this measurement for the command given as its params.
    $ time ls -lt
    real    0m0.873s
    user    0m0.010s
    sys     0m0.030s

Maybe you are looking for

  • Safari won't open - thread 0 crashes

    I want to use Safari but am unable to open it. (My ISP offers software that accelerates my dial-up connection, but it needs Safari to run.) I had OS X 10.2.6 with an unknown version of Safari (whatever it came with). Safari did not appear in the desk

  • IMac Not Recognizing External Hard Drive

    Hi friends, I recently upgraded my MacBook from 5 years ago to the newest iMac. In doing so, I transferred my computer using Time Machine & my external hard drive. The hard drive is partitioned to allow for storage as well as Time Machine backups. I

  • Java canot find symbol class

    i have create 2 class this is the first class public class Book{ private String BookTitle; private String BookAuthor; private int yearPublished; public Book(String Title, String Author, int yr){ BookTitle = Title; BookAuthor = Author; yearPublished =

  • Heding in classical report

    hi friends, i a classical report, am facing a prob displaying the headings. one of the column, for eg is Rate of Duty. I want the output length of this column to be 7....but if i give this the heading is getting truncated...i want the heading to come

  • Urgent Need of Doc

    Hello!!!! Please provide basic frequently asked interview questions on CUBE, CUSP and CUCM. I need them on urgent basis so that i can clear my interview. Needed those docs today as tomorrow is my interview. BR Akriti