How to find the Latency time in java.

How to find the Latency time in java.

long start = System.currentTimeMillis();
doTheWork();
long durationInMillis = System.currentTimeMillis() - start;You might repeat doTheWork() several (100-1000 or more) times if it is fast and the granularity of your system clock is not good enough.

Similar Messages

  • How to find the Execution Time for Java Code?

    * Hi everyone , i want to calculate the execution time for my process in java
    * The following was the ouput for my coding,
    O/P:-
    This run took 0 Hours ;1.31 Minutes ;78.36 Seconds
    *** In the above output , the output should come exactly what hours , minutes and seconds for my process,
    but in my code the minutes are converted into seconds(It should not)...
    * Here is my coding,
        static long start_time;
        public static void startTime()
            start_time = System.currentTimeMillis();
        public static void endTime()
            DecimalFormat df = new DecimalFormat("##.##");
            long end_time = System.currentTimeMillis();
            float t = end_time - start_time;
            float sec = t / 1000;
            float min = 0, hr = 0;
            if (sec > 60) {
                min = sec / 60;
            if (min > 60) {
                hr = min / 60;
            System.out.println("This run took " + df.format(hr) + " Hours ;"+ df.format(min) + " Minutes ;" + df.format(sec) + " Seconds");
        }* How to Calcualte exact timing for my process....
    * Thanks

    * Hi flounder, Is following code will wotk perfectly?
         public static void endTime()
              DecimalFormat df = new DecimalFormat("##.##");
              long end_time = System.currentTimeMillis();
              float t = end_time - start_time;
              float sec = t / 1000;
              float min = 0, hr = 0;
              while(sec >= 60){
         min++;
         sec = sec -60;
         if (min >= 60){
         min = 0; //or min = min -60;
         hr++;
              System.out.println("This run took " + df.format(hr) + " Hours ;"+ df.format(min) + " Minutes ;" + df.format(sec) + " Seconds");
         }

  • How to find the  System Dbtype in java code

    How to find the System Dbtype in java code
    I need various Db connection my project (oracle, sq l,sybase,db2),So How to find the System Dbtype in java code

    Welcome to the Forums.
    Please go through the FAQ of the Forum.
    You has posted your query in the wrong Forum, this one is dedicated to Oracle Forms.
    Please try {forum:id=1050}.
    Regards,

  • How to find the processing time of any query?

    im using oracle express edition, can anyone help me, how to find the processing time of any query?

    Trace the query and tkprof the generated trace file.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/sqltrace.htm#PFGRF01010

  • How to determine the latency time?

    Hi
    How do I determine the latency time?
    I need to connect 3 CAN nodes onto the CAN bus and need to know how to determine the delay(latency) time needed between the transmission of a message from one node and reception at the other,
    The latency time and Bandwidth both play a role in the transmission, right?
    Thanks
    Ekta

    Hi Ekta,
    The software you need if you are using an NI board is NI-CAN, and you can look at the driver download page for the appropriate version for your operating system. I'll suggest you take a look at the example programs that install with that driver to get you started. If you are developing using LabVIEW or LabWindows/CVI, go to Help>>Find Examples>>Hardware Input and Output>>CAN for examples. If you are using Visual Basic or C, go to ...\National Instruments\NI-CAN for examples. I have also attached a LabVIEW example below that shows how to enable self reception.
    If you are using another vendor's CAN board, you will need to install their driver, and see if they have any examples to get you started. I assume the approach for measuring the latency will be similar to what I suggested. Hope this helps. Goodluck!
    Regards,
    Message Edited by _Belle on 04-28-2006 07:42 AM
    Ebele O.
    National Instruments
    Attachments:
    Self_Reception.vi ‏97 KB

  • How to find the execution time of a query?

    hi guys,
    i need to find the execution time of a query.
    i tried finding it in rsrt but couldn find the execution time.
    pleasse let me know the way to do it..
    regards
    sagar

    Hi sagar,
    If you want to know the frontend time, first of all you need to maitain the BW Statistics. To maintain you have to go the respective target and click on it. Go to the tools, select BW Statistics of infoprovider. It pop ups a window there you find two check boxes 1) WHM and 2) Front end time. Check both.
    Now Exe query and close the analyzer. Then go to SE11 table RSDDSTAT. There is one field which displays Frentend time.
    OR
    Go to STO3 here also you can analys the frontend time.
    If you feel useful Assign Pts.
    Regards,
    Vishal

  • How to find the Executed time of query

    hi,
       i want to find out the execution time of query like a sales report executed in 10 min. how to find out that? is there is any TC for that or what is the option to use that?
    and how to fing out execution time of Data source to info providers.. or DSOs to IC? like how much time taken to load data?
    regards,
    preety

    Hello Preety,
          Goto RSRT give the query name and see the technical property you will find the query generation time.
    For the time taken for execution Select the execute and debug mode in the options select display statistics.
    Execute the query
    Click back
    You can see the statistics.
    Thanks
    Chandran

  • How to find the transport time?

    Dear all,
    Our inbound delivery document's delivery date calculation = Actual GI date in Outbound Delivery + transport time.
    My question how do i find out the transport time? where in the outbound dlivery document state this and where in the SPRO stated the outbound dlivery time?
    thanks
    Tuff

    SAP online help:
    The route determines the means of transport and the legs involved. It influences transportation scheduling. For example, the system can determine from the route that goods are to be sent by rail to Boston. Therefore, during transportation scheduling, it takes into account how far in advance loading space in the freight car must be reserved.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/5607da545a11d1a7020000e829fd11/frameset.htm
    LIKP-ROUTE is the route assigned to the delivery, it is not time. As you can see route has an impact on scheduling but it is only one factor.
    Please read SAP online help about delivery scheduling:
    http://help.sap.com/erp2005_ehp_05/helpdata/EN/dd/5607e7545a11d1a7020000e829fd11/frameset.htm.
    I think it's better you take your time and and invest some energy in reading the help, there's no point in writing down the same again on the forum.
    In customizing you can go into the definition of the route and check the help for customizing node as well as F1 help for the route-fields.
    Edited by: Csaba Szommer on May 12, 2011 9:16 AM

  • How to find the elapsed time between 2 events ?

    I want to use the robot class and I have register all events in a file but when I use the Robot. It isn't synchronous. So I should find th elapsed time between two events for reproducing them with the method delay of the class Robot.
    Thanks

    It sounds like you want to reproduce the events with varying time between the events? This is a good idea for a couple of reasons 1) it's possible to enqueue events so quickly that Robot gets ahead of the Java GUI, and 2) every human does their mouse/keyboard activity at varying (and relatively slow, relative to the computer that is) rates of speed. It would help make a more realistic interaction to vary the speed of event reproduction.
    Since you can't control the amount of time between the call to Robot and when the event arrives in the application, you can't be ultimately precise about this. You'll have to accept a teensy bit of slop in the process and just live with it.
    That is ... you can do something like robot.method1() .. Thread.sleep(1) .. robot.method2() .. Thread.sleep(1) ... and that will give slight delays. If you vary the value for Thread.sleep you can vary the event reproduction speed. Early in the development of Robot I experimented with something like this - I set up an EventQueue listener to capture all mouse/keyboard events (remember that each comes with a timestamp) and then reproduced events using the time intervals from the captured events to control the Thread.sleep times between Robot calls. It worked pretty well, and the mouse would dance around in the same way I moved the mouse around.
    - David

  • How to find the Response time for a particular Transaction

    Hello Experts,
            Am implementing a BAdI to achieve some customer enhancement for XD01 Transaction . I need to confirm to customer that after the implementation and before implementation what is the response time of the system
    Response time BEFORE BAdI Implementation
    Response time AFTER BAdI Implementation
    Where can i get this.
    Help me in this regard
    Best Regards
    SRiNi

    Hello,
    Within STAD, enter the time range that the user was executing the transaction within as well as the user name. The time field indicates the time when the transaction would have ended. STAD adds some extra time on using your time interval. Depending on how long the transaction ran, you can set the length you want it to display. This means that if it is set to 10, STAD will display statistical records from transactions that ended within that 10 minute period.
    The selection screen also gives you a few options for display mode.
    - Show all statistic records, sorted by star
    This shows you all of the transaction steps, but they are not grouped in any way.
    -Show all records, grouped by business transaction
    This shows the transaction steps grouped by transaction ID (shown in the record as Trans. ID). The times are not cumulative. They are the times for each individual step.
    -Show Business Transaction Tots
    This shows the transaction steps grouped by transaction ID. However, instead of just listing them you can drill from the top level down. The top level will show you the overall response time, and as you drill down, you can get to the overall response time.
    Note that you also need to add the user into the selection criteria. Everything else you can leave alone in this case.
    Once you have the records displayed, you can double click them to get a detailed record. This will show you the following:
    - Breakdown of response time (wait for work process, processing time, load time, generating time, roll time, DB time, enqueue time). This makes STAD a great place to start for performance analysis as you will then know whether you will need to look at SQL, processing, or any other component of response time first.
    - Stats on the data selected within the execution
    - Memory utilization of the transaction
    - RFCs executed (including the calling time and remote execution time - very useful with performance analysis of interfaces)
    - Much more.
    As this chain of comments has previously indicated, you are best off using STAD if you want an accurate indication of response time. The ST12 (combines SE30 ABAP trace and ST05 SQL trace) trace times are less accurate that the values you get from ST12. I am not discounting the value of ST12 by any means. This is a very powerful tool to help you tune your transactions.
    I hope this information is helpful!
    Kind regards,
    Geoff Irwin
    Senior Support Consultant
    SAP Active Global Support

  • How to avoid the run time error  "java.lang.OutOfMemoryError"

    hi
    i have written a code to read a txt file ,i used FileReader to read a file . the code is working well for small txt files. but when i tried to read a large file(greater than 2MB), a run time error called "java.lang.OutofMemoryError" appeared .
    plz suggest the methods to read txt files of large capacity(greater than 25MB) .if possible give an example.

    thanks for ur replies
    i am new to java programming .i am a student persuing B.Tech final semester .i got struck in my project while reading a large txt file(greater than 3MB) . i am now giving a part of code that i had used in my project .it working fine with the txt files less than 3MB ,but when i am treing to read a file greater than 3MB , it is displaying a run time error "java.lang.outofmemoryerror"
    i have tried using "java -Xmx" ,it is working , but is there any better option ??
    here is the part of code:
       FileReader fin;
        al=new ArrayList();
         try
              fin=new FileReader(filename);
         catch(FileNotFoundException e)
           System.out.println("File not foumn");
         return;
    while((i=fin.read())!=-1)
           al.add(new Character((char)i));
         fin.close(); 
         Object obj[]=al.toArray();plz help me
    --santosh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to find the event time segment details from delivery document

    Hi,
    In the delivery document at header level in Dates tab i have maintained begining Plan date where Event = Shipment.
    But that field is in structure.
    How to fetch those(Begining Plant Date) details in to report,
    I have tried from Function module side also, i have not found any function module which is related to this field.
    If any body give some solution, that will be great help for me.
    Regards
    Lakshmikanth

    I have tried with those table(TSEGH & TSEGE), i have not found the begin plan date for that event. where event = shipment.
    We are using 4.7 version. Here we have found one function module: TSEG_DIALOG_DATA, but iam unable to find the input details.
    Here the input options are:
    IF_HANDLE
    IF_DIALOG_VIEW
    IF_DIALOG_ZONE
    May i know what are these inputs, what exactly i have to pass to this function module.

  • How to find the execution time

    Hi
    I don't know whether it is possible in Oracle or not?
    Say i have got around 20 odd Views in my DB and couple of them based on Materialized View which is again created by joining more than 5 based tables.
    Even most of the Views are also created by joining base tables and MV's.
    When i execute Select count(*) from <viewname>;
    I do get the count of rows and on avg each view returns more that 30lacs row.
    And when i excute select * from <View_name> by setting the Time on.
    It takes more than 2 hours to return the rows.I know the elapsed time of a query do depend of external factors as well such as number of users using the DB Object used in thoe views,Number of process involved and all.
    And therefore in order to gather the elapsed time of each and every view will take more than a week .
    I would appreciate if anyone can provide me a better approach or even a shell script or something like that which will give me the elapsed time of all the views if i query (Select * from <view_name>);
    Thanks in advance.
    Vineet

    But to SomeoneElse's point, if you are running
    SELECT * FROM view_namefrom SQL*Plus, what you are primarily measuring is how fast your network is (because you're spending a great deal of time sending data from the database to the client) and the speed of the SQL*Plus client on your machine (which has to fetch that data, which may have to format and display that data, etc.) It is not a particularly meaningful metric. If you tuned the client machine so that SQL*Plus wasn't displaying the data, if you increased the fetch size, etc. you could drastically decrease the time it would take to send all the data to your client machine, but that is probably not going to constitute tuning for anyone other than you (i.e. you might see a halving of run time while everyone else saw no change).
    Beyond that, doing a SELECT * with no criteria is likely to involve execution plans that no one else will see, data access patterns no one else will see, etc. which just makes the benchmark you are proposing irrelevent.
    If you really, really want to measure how quickly your client can pull the data from all the views, you could of course let that run for a week. But the number wouldn't mean anything.
    Justin

  • How to find the exact time backup run

    Hi,
    I would like to know the specific date ( hour + minute) a backup was executed.
    For example the output of rman command : list backup of database;
    show Completion Time : 08-MAY-12 . I would like to get the exact time .
    Please advice.
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    33627   Incr 1  256.00K    SBT_TAPE    00:00:05     08-MAY-12    <<<<<<======
            BP Key: 33994   Status: AVAILABLE  Compressed: NO  Tag: TAG20120507T230332
            Handle: bzq1<bzq1_inc_889661:782699508:1>.dbf   Media:
      List of Datafiles in backup set 33627
      File LV Type Ckp SCN    Ckp Time  Name
      279  1  Incr 8042759810240 08-MAY-12 /bzq1/oracalls_2011_data2/y0211pricing_internet04.dbf
    .....Thanks

    I took level 0 rman database backup.
    The problem is that there are also level 1 backup which seems to be run at the very same time.
    For eample :
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    31891   Incr 1  3.00M      SBT_TAPE    00:01:25     07-MAY-12                               <<<<<=== level 1
            BP Key: 32278   Status: AVAILABLE  Compressed: NO  Tag: TAG20120507T230332
            Handle: bzq1<bzq1_inc_889062:782696160:1>.dbf   Media:
      List of Datafiles in backup set 31891
      File LV Type Ckp SCN    Ckp Time  Name
      103  1  Incr 8042758295621 07-MAY-12 /bzq1/oradata3/data06_ts_17.dbf
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    31892   Incr 0  1.18G      SBT_TAPE    00:00:34     07-MAY-12                                        <<<<<=== level 0
            BP Key: 32279   Status: AVAILABLE  Compressed: NO  Tag: TAG20120507T200203
            Handle: bzq1_full<bzq1_889069:782696225:1>.dbf   Media:
      List of Datafiles in backup set 31892
      File LV Type Ckp SCN    Ckp Time  Name
      528  0  Incr 8042758303427 07-MAY-12 /bzq1/oracalls_2011_data3/q311_calls_ts_10.dbf
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    31893   Incr 1  256.00K    SBT_TAPE    00:01:24     07-MAY-12                                              <<<<<=== level 1
            BP Key: 32280   Status: AVAILABLE  Compressed: NO  Tag: TAG20120507T230332
            Handle: bzq1<bzq1_inc_889065:782696196:1>.dbf   Media:
      List of Datafiles in backup set 31893
      File LV Type Ckp SCN    Ckp Time  Name
      154  1  Incr 8042758299495 07-MAY-12 /bzq1/oradata5/tc_deb_cred_tb_11.dbf
    BS Key  Type LV Size       Device Type Elapsed Time Completion Time
    31894   Incr 0  1.36G      SBT_TAPE    00:01:55     07-MAY-12                                                    <<<<<=== level 0
            BP Key: 32281   Status: AVAILABLE  Compressed: NO  Tag: TAG20120507T200203
            Handle: bzq1_full<bzq1_889064:782696169:1>.dbf   Media:
      List of Datafiles in backup set 31894
      File LV Type Ckp SCN    Ckp Time  Name
      576  0  Incr 8042758296792 07-MAY-12 /bzq1/oracalls_2012_indx1/Q112_icalls_ts_07.dbf

  • How to find the real-time Zero point location ?

    I want to get a real-time phase difference between current and voltage waveform with the same harmonic frequency.for this reason I must know real-time zero or peak location.could you tell me how to do it?

    Hello;
    The best way to do phase difference analysis is by using one of the Simultaneous Multifunction I/O DAQ boards, such as the 6110.
    That board has one ADC per channel, meaning that the acquisition is trully simultaneous. If you hook up the voltage waveform to one channel and the current waveform (through a resistor) to another, you can see the phase difference in a simple graph.
    Hope this helps.
    Filipe

Maybe you are looking for