Timing granularity - how precise can I be?

I have heard noises about Java not being able to handle extremely precise timing tasks. Specifically, I have heard that Timers and Thread.sleep() do not generally perform as might be expected.
I am working on an application involving serial port traffic, and the spec includes an 80 millisecond timeout between the beginning and end of a packet (If the packet is not complete within 80 milliseconds, drop it and reset the listener).
Can I expect this level of precision to work accurately? Are the numbers I get from System.currentTimeInMillis() likely to correspond, to the millisecond, to the actual time the byte arrives at the UART?
If not, I welcome suggestions about how to make this happen.

You certainly don't need RTJ and you don't need to
worry about the precision of Java timers either. See
http://java.sun.com/products/javacomm/javadocs/javax/c
omm/CommPort.html#enableReceiveTimeout(int). This
says that the timeout is implemented by the serial
port driver, not by Java.Interesting, but not useful in this case :
"when this many milliseconds have elapsed, return immediately from read, regardless of bytes in input buffer."
The timeout I am monitoring is between the first and last bytes of a message, not for any data recieved.

Similar Messages

  • HT4628 some times my internet connection will say it has timed out and I can not connect. but my friends mac never has a problem. How can I fix this?

    some times my internet connection will say it has timed out and I can not connect. but my friends mac never has a problem. How can I fix this?

    Just confirming, when you have the trouble, the wifi icon is grayed-out or has all bars showing? I believe you are saying that is is grayed-out - not connected to your wireless router.
    I have a Mini that started to lose connection to the Internet after the 10.7.3 update but still showed the wireless as connected. If I pinged the wireless router, I would get a quarter of the packets failing to return. The router was a Netgear that supported 802.11N connections. As a test, I set it to 802.11G (54MBps) maximum and the Mini worked fine for a week - no dropouts. And for the other devices that did support 802.11N, while there was a noticeable delay with downloads and pages loading, they still worked.
    As another test, I changed the Netgear router to a Billion 802.11N model and the Mini has not had a problems since. (It is still using 802.11g). So it could be your router that is causing trouble for your Mac.
    Have a look at some of the More Like This postings in the right column. There has been a number of Mac owners experiencing wifi connection issues and some very good suggestions as to how to resolve their issue.

  • How we can set timing in VA02.

    Hi All,
    How we can set the timing to "Send with periodically processed job" in VA02.
    Thanks in advance,
    SN

    Goto Output and hit further data tab.There you will find the date and time fields.
    Hi u can close the question if it is answered. do u need any other input regarding this issue?
    Edited by: Sam C on Oct 31, 2008 11:21 AM

  • Having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this

    having a problem with dates when I send my numbers doc to excel. dates are all out and that they have to cut and paste individual entries onto their spreadsheet. Any idea how I can prevent this.
    I'm using Lion on an MBP and Numbers is the latest version

    May you give more details about what is wrong with your dates ?
    M…oSoft products aren't allowed on my machines but I use LibreOffice which is a clone of Office.
    When I export from Numbers to Excel and open the result with LibreOffice, the dates are correctly treated.
    To be precise, dates after 01/01/1904 are correctly treated. dates before 01/01/1904 are exported as strings but, as it's flagged during the export process, it's not surprising.
    Yvan KOENIG (VALLAURIS, France) mardi 3 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • Hi!!I have some problems with the synchronization of my system, and I don´t know how I can solve this!

    My system consists of differents vi´s.Some of them are used to read analogic inputs and digital inputs, using the serial port.
    The values that I read, go through differents vi to be proccesed, and at the end, these values are written in a file, all the values in the same file.
    My problems of synchronization are:
    1. I have one vi per input, and all of them use the same serial port. How can I synchronize them to avoid serial port conflicts? (using queues??) And how can I do, to get differents number of samples/sg with every vi? I have to introduce them in differents loops?
    2. The other problem is that, for example, I want to read 8 samples/ s but I only want
    to write two samples every second. How can I do to avoid stoping the data flow?
    Maybe, my problem is that I want to see the system like
    one block, and I am ignoring that, although all the system works like a block, every part works using a different "speed". I don´t know how tools can I use to combine two ideas, working like an only system( data dependence, some vis need the data of others vi to be able to work) and working getting differents numbers of samples/s.
    I have seen that there are synchronization vis. I am going to glance at them, maybe I find something interesting but I amsure that your help will be very useful?
    Thanks in advanced!!
    Graci

    I think you are pretty much on the right track with Queues. I have implemented a very similar system myself using queues. I have even different systems connected to the serial interface, but I can synchronise them all easily using the following method:
    1) Make a VI for opening the serial port and reading the data. The data (parsed to extract the numbers required) are then stored in an array (Shift register). If the pre-determined time delay is reached (say 5 seconds) the values are averaged and written to a Queue with a defined data type. Save the VI as a VI template.
    2) Make a VI which starts an instance of this template VI for every channel you require. You can use VI Server to set values on the new front panel before you set it's property to "running". Setting a timer value for all can help ensure that the X-Axis of your timing values (if you require) are synchronised. The clue here is to define and initiate a QUEUE per channel. (RS-232_1, RS-232_2 and so on). The QUEUE name needs to be passed to the VI Template before running so that each VI running in the background has an individual link to the main program.
    The second part of this VI simply uses an array of QUEUES, polling them one after another with a timeout of, say 5 ms. If data is found, append accordingly to an XY-Graph.
    I also add in some "Auto termination" in the VI template (MAx number of values allowed in the QUEUE for example) to allow for the background processes to find out if the front-VI is still running or not. There are many different ways to do this, shoose the best for your application.
    With this approach, it's not even important what instrument is connected as long as data is written in a specified format into a known QUEUE. I have also developed systems where I can transparently (almost) drop in VI Templates for instruments with similar functionality (output data) from different suppliers.
    I would post an example, but the time it would take me to clean it up is too large. Sorry. If you have any further questions, don't hesitate to ask further questions.
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • Im having trouble changing my security questions, they are from years ago so i do not remember them and the reset email is no longer active,and i dont know how i can use the account because i added money to it but it asks for the questions. anybody help??

    im having trouble changing my security questions, they are from years ago so i do not remember them and the reset email is no longer active.., and i dont know how i can use the account because i added money to it but it asks for the questions. anybody help??
    this says it all..

    Welcome to the Apple Community.
    Contact Apple through iTunes Store Support, and explain that you have forgotten your 3 security questions, that you can reset your password, but doing so doesn't reset your security questions.
    Remember, support will receive hundreds, if not thousands of requests per day, some from people trying it on, others with little explanation and others that are written extremely poorly. Take the time to explain your situation properly, be precise and concise, brief but comprehensive.

  • I just reinstalled iTunes, and it will not open, as it says iTunes library itl. was created from an earlier version. Any idea what this means, and how I can get itunes to open?

    I just reinstalled iTunes, and it will not open, as it says iTunes library itl. was created from an earlier version. Any idea what this means, and how I can get itunes to open?

    Many thanks.
    That suggests that another application has stashed old QuickTime componentry in your system files.
    So just in case we'll go looking for older QuickTime componentry in the most common locations for it to be stashed.
    First we'll need to change some view settings.
    In your Start menu, open Computer.
    In your Organise menu, select Folder Options.
    In the View tab, make sure that "Show hidden files and folders" is selected, and Hide extensions for known file types is unchecked.
    Click OK.
    Now in Computer, open your C:\ drive (or whichever drive you have your operating system installed on).
    Open the "Windows" folder.
    If you have a 32-bit version of Windows, open the "System32" folder.
    If you have a 64-bit version of Windows, open the "SysWOW64" folder.
    What files and folders can you see in there with QuickTime in the title? (In a standard installation of Quicktime you should be seeing precisely two files... QuickTime.qts and QuickTimeVR.qtx ... and no QuickTime folders whatsoever.)

  • How we can add custom field in standard report 2kee.

    Hi,
    How we can add custom field in standard report 2kee.
    I need one extra field to add in 2kee report for the same is there any customization req.
    Regards
    Ravi

    Ravi,
    Which extra field do you want to add or see?  Without specifying the field, it is difficult for one to tell you precisely whether you need a custom field or just change the layout to get the standard one.
    There are so many fields which exists but are not displayed when you execute 2KEE. You need to change the layout selections to your preference.
    Nonetheless, if the field you want to add does not already exist, then yes you can do customization.  Is there a customization requirement? No. But remember, you are making changes to SAP Standard program which will no longer be supported by SAP should in the case an issue arise in the future related to this very program.
    Have your abaper add the said field in the program or why not just create a query to pull the report?
    Elias
    Edited by: Elias Akorli on Sep 18, 2009 9:02 PM

  • How i can Integrate My Applications In to One Appliction In ADF

    Hi All
    Am creation 10 Application((ADF BC JSF )20 Application Modules ) for one project its big project so 10 members are involved in to the production but am not using any Version technique but i want all 10 application should be integrated in one application how i can go forward , How i can go further

    There are several areas you might want to read in the ADF Developer Guide:
    Nested AM and AM Granularity
    http://download.oracle.com/docs/html/B25947_01/bcservices009.htm#sm0229
    ADF BC libraries
    http://download.oracle.com/docs/html/B25947_01/bcadvgen007.htm#CHEFECGD
    Multiple JSF configuration files:
    http://download.oracle.com/docs/html/B25947_01/web_getstarted002.htm#CHDJHIGJ

  • Software update on iMac. Trying to update software I get message "an error has occurred. the request has been timed out" how do i know if there are updates?

    Am trying to update software through "Software Update" on my iMac (latest Lion operating system).
    I keep getting message "An error has occurred. The request timed out"
    How do I know if there are software dates available to down load.
    Ernie

    Two things, bushmanernie (love the name)
    First what version of Lion are you running and have you downloaded any Combo updates since you installed it.
    Second; I see you only have 10.6.2 in your profile.   You might like to update it.
    I don't have Lion myself but I'm guessing you don't have the very latest version.  You can check what should be available through the opening Apple support page > downloads.

  • How I can change visible property of an af:table with an af:selectOneRadio?

    How I can change visible property of an af:table with an af:selectOneRadio? Anyone can help me with a tutorial, example or link?
    Thanks in advance.

    After you add the required libraries to your classpath
    you can do your use case as explained in this sample
    page source
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="untitled2.jsf" id="d1">
            <af:messages id="m1"/>
            <af:form id="f1">
                <af:selectOneRadio label="radio" id="sor1" autoSubmit="true"
                                   valueChangeListener="#{ControlVisibilty.onRadioSelected}">
                    <af:selectItem label="0" value="0" id="si1"/>
                    <af:selectItem label="1" value="1" id="si2"/>
                </af:selectOneRadio>
                <af:table value="#{bindings.DepartmentsView1.collectionModel}" var="row"
                          rows="#{bindings.DepartmentsView1.rangeSize}"
                          emptyText="#{bindings.DepartmentsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.DepartmentsView1.rangeSize}" rowBandingInterval="0"
                          selectedRowKeys="#{bindings.DepartmentsView1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.DepartmentsView1.collectionModel.makeCurrent}" rowSelection="single"
                          id="t1" partialTriggers="::sor1" visible="#{ControlVisibilty.table}">
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.DepartmentId.label}" id="c1">
                        <af:inputText value="#{row.bindings.DepartmentId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.DepartmentId.label}"
                                      required="#{bindings.DepartmentsView1.hints.DepartmentId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.DepartmentId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.DepartmentId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.DepartmentId.tooltip}" id="it1">
                            <f:validator binding="#{row.bindings.DepartmentId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.DepartmentId.format}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.DepartmentName.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.DepartmentName.label}" id="c2">
                        <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.DepartmentName.label}"
                                      required="#{bindings.DepartmentsView1.hints.DepartmentName.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.DepartmentName.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.DepartmentName.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.DepartmentName.tooltip}" id="it2">
                            <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.ManagerId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.ManagerId.label}" id="c3">
                        <af:inputText value="#{row.bindings.ManagerId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.ManagerId.label}"
                                      required="#{bindings.DepartmentsView1.hints.ManagerId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.ManagerId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.ManagerId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.ManagerId.tooltip}" id="it3">
                            <f:validator binding="#{row.bindings.ManagerId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.ManagerId.format}"/>
                        </af:inputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsView1.hints.LocationId.name}" sortable="false"
                               headerText="#{bindings.DepartmentsView1.hints.LocationId.label}" id="c4">
                        <af:inputText value="#{row.bindings.LocationId.inputValue}"
                                      label="#{bindings.DepartmentsView1.hints.LocationId.label}"
                                      required="#{bindings.DepartmentsView1.hints.LocationId.mandatory}"
                                      columns="#{bindings.DepartmentsView1.hints.LocationId.displayWidth}"
                                      maximumLength="#{bindings.DepartmentsView1.hints.LocationId.precision}"
                                      shortDesc="#{bindings.DepartmentsView1.hints.LocationId.tooltip}" id="it4">
                            <f:validator binding="#{row.bindings.LocationId.validator}"/>
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsView1.hints.LocationId.format}"/>
                        </af:inputText>
                    </af:column>
                </af:table>
            </af:form>
        </af:document>
    </f:view>The managed bean code is
    import javax.faces.event.ValueChangeEvent;
    public class ControlVisibilty {
        private boolean table;
        public ControlVisibilty() {
            setTable(false);
        public void onRadioSelected(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            if(valueChangeEvent.getNewValue().toString().equals("1"))
                setTable(true);
            else
                setTable(false);
        public void setTable(boolean table) {
            this.table = table;
        public boolean isTable() {
            return table;
    }

  • How i can use isqlPlus DBA and ISQLPlus from the web browser

    Hi
    thank you for reading my post
    how i can use isqlPlus ?
    after i instlled Oracle 10gr2 it said that my isql plus is accessable from
    http://127.0.0.1:5560/isqlplus
    but when i navigate to this url , it asks me for a username and password
    i can not connect to it by using : system/system that i use to connect to Enterprise manager.
    when i use system/system to connect to sqlPlus it says :
    401 Unauthorized
    what is username for isqlplus ?
    what is its use ?
    when we need to use isqlPlus and when we need enterprise manager
    where i can find resources for learning isqlplus
    Thanks
    null

    "Well, I think you're referring to my previous post, and yes, my definition was not precise enough, but if you read carefully I specified "where you execute Sql commands", and it was just opposite to EM."
    Not sure I caught all that.
    Actually, I wasn't responding to your post at all. In 9i, you could not develop PL/SQL within the iSQLPlus interface. You could call procedures and functions, but the DECLARE/BEGIN/END syntax would throw an "unsupported" error. They may have upgraded the feature set in 10g, and if so, then my comment may not apply. I didn't catch which specific version the question was about. My bad. All I was trying to do was point out benefits of each. Picking a tool to use should be based upon your knowledge of each tool and the benefits they provide in acheiving your goal.

  • How I can lock my Time Capsule on specific MAC addresses?

    How I can lock my Time Capsule on specific MAC addresses?

    Ok, you mean MAC filtering..
    This is called timed access on the airport utility..
    Set no access for all other wireless.
    Then add for your own.
    Setup all the computers that you want to have access and whatever the time..
    You can only MAC filter wireless clients not wired.
    Do a search if this is not enough for posts by Bob Timmons on Timed Access.

  • I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    The application Acrobat provides no language translation capability.
    If you localize the language for OS, MS Office applications, Acrobat, etc to the desired language try again.
    Alternative: transfer a copy of content into a web based translation service (Bing or Google provides a free service).
    Transfer the output into a word processing program that is localized to the appropriate language.
    Do cleanup.
    Be well...

  • I am sharing a apple id acount with my family but when i synced my phone to the computer it erased all of my imformation and put the other phone's imformation on it. I was wondering how I can prevent this from happening?

    I am sharing a apple id acount with my family but when I synced my iphone to the computer it erased all of my imformation and put the other phone's imformation on it. I was wondering how I can prevent this from happening?

    If the ringtones are on the old device just plug it in and do a transfer of purchases then they will be on the computer to sync to the new device.

Maybe you are looking for

  • Ipod is not recognized by the windows our the itunes

    Hi I receive my ipod nano(2gb) by August, it was running fine, without a problem, but now i can recharge it because windows our itunes does not recognized my ipod is connected. I even have try to recharged in true the electricity but the resolte was

  • How can I overwrite existing reports with Publish Wizard?

    Hi, I uploaded a lot of reports to the Crystal Reports Server 2008 CMS using the Publish Wizard. Now, when I upload changed reports again, the Publish Wizard does not overwrite the existing reports. Instead it renames the new report as "<Name> (2)".

  • CAN WE CREATE TWO WF ACCOUNT ON SINGLE DATABASE

    I have requirement to create two separate WF account for development and production. so can i create it on single database? i think again i need to run workflow configuration assistant with different name. but what should be TNS connect descriptor in

  • Best way to show the following data?

    Hi Experts, I am designing a validation solution in java webdynpro. I need to process 1000 records against certain logic and need to show the errors in the interface..Each record has more than 30 columns. I would like to get your suggestions on, 1. H

  • How to resolve the 0xE8000001 error??

    please help me, my iPod Touch 4g doesn't want to connect with iTunes