How can I get the run time of a method?

I click a button "draw" to invoke a method such as draw many shades.
It hangs a long time.
I want to get the information of how long it spent.
How can I do it?
I'm new guy, more detailed please .
one example would be much better
ThankS all :)

Try JAMon. It is much more flexible than currentTimeMillis() and easier to use.
import com.jamonapi.*;
drawShape()
Monitor mon=MonitorFactory.start();
  ..code being timed...
System.out.println(mon.stop());// prints time in ms.
}steve - http://www.jamonapi.com - a fast, free, simple performance tuning API.

Similar Messages

  • How can I test the running time of a method?

    c.What is the running time of your method smallest, as a function of n, the number of elements in the list? Use big-Oh notation.
    I quoated from a java problem..
    Anyone can tell me how I can test the running time? Thanks ! :D

    it depends on what is in the method. For example a for loop executed n times would have a O(n). A double for loop (each loopp run n times) will have O(n^2). Do this: determine how many times each loop in the method is run. This is the first term in your runtime equation. Do this for all other loops in the method and add them all together. Most other statements that are not iterative should have a constant runtime so O(1). For conditional statements, the runtime depends on the most time consuming portion of the statement. Once all these are added together, take the O(equation) which should just leave the biggest term. i.e. O(5n^2+3n+8) = O(n^2). Hope this helps.
    note: this does not apply to recursive methods

  • How can I get the elapse time for execution of a Query for a session

    Hi ,
    How can I get the elapse time for execution of a Query for a session?
    Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
    Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
    Thanks in advance.

    Hi
    You can use the dbms_utility.get_time tool (gives binary_integer type value).
    1/ Initialize you time and date of beginning :
    v_beginTime := dbms_utility.get_time ;
    2/ Run you procedure...
    3/ Get end-time with :
    v_endTime := dbms_utility.get_time ;
    4/ Thus, calculate elapsed time by difference :
    v_elapsTime := v_endTime - v_beginTime ;
    This will give you time elapsed in of 100th of seconds...
    Then you can format you result to give correct print time.
    Hope it will help you.
    AL

  • How can I get the Date & Time to appear on my final project in iMovie11?

    I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear.  How can I get the Date  & Time data to appear on the final product?

    There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.

  • In LV6.1, can I get the run-time menu refnum of a VI from the VI Path?

    Actually, for any version of LabVIEW, can I get the run-time menu refnum from the VI Path (or the VI reference)?
    Thanks!
    Enrique
    www.vartortech.com

    I just thought of a workaround...you could have a Menu Bar Ref indicator on your main VI front panel.  When your VI runs, you could have the Current VI's Menubar function wire the refnum into that indicator.  Then, in your subVI that has the VI reference, you could use VI Server to read the value of that indicator, then cast the value into a refnum wire, then you'd have access to the menubar reference in the subVI without having to pass it in to a subVI terminal.  Would that work?
    Oh, another simpler idea would be to simply wire the Menubar reference into a global, and read that global in the subVI.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How can i get the executing time of a IMAQ function.function could be IMAQ acquire IMAQ acquire.

    how can i get the executing time of a IMAQ function.function could be IMAQ acquire IMAQ acquire.

    Hello,
    This question was answered under a different category, here is the link:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000004EBA0000&HTHREAD=000047694&UCATEGORY_0=_15_&UCATEGORY_S=0
    Regards
    Russell B.
    National Instruments
    Applications Engineering
    Engineering Team Leader
    G Systems, www.gsystems.com
    Certified LabVIEW Architect
    Certified Professional Instructor

  • How can i get the System Time from the other host

    I want to get the System Time from the other host in the LAN,How can I get the Time using Java.
    Such as I am in WIN 2000 and I have a Unix host in LAN, I want to get unix host System time, How can I do it.

    Open a socket to port 13 and read a string with the time.
    -or-
    Open a socket to port 27 and read 4 bytes that are a network order timestamp
    Assuming that your UNIX machine has those services running, most do

  • How can I get the query name in webitem method ?

    Hello,
    I have defined a new web item but I can't retrieved parameter of my webitem in the RENDER method for instance. I have declared a parameter in the RSRRENDERATR table like this :
    REN_NAME : MY_WEBITEM
    ATR_NAME : MY_PARAM
    ATR TYP : TEXT
    CHR MAX LEN : 50
    How can I do this ? How can I get the MY_PARAM value in the RENDER method ?
    Thanks a lot
    GC.
    Edited by: CoGr on Feb 11, 2008 12:10 PM

    Hi ,
    data l_r_view type ref cl_rsr_www_view.
    data l_t_text_symbols type rrx1_t_txt_symbols.
    l_r_view =? n_r_data_provider.
    CALL METHOD L_R_VIEW->n_r_request->TEXT_ELEMENTS_GET
      IMPORTING
        E_T_TXT_ELEMENTS = l_t_text_symbols.
    l_t_text_symbols contains all DP information like Query technical name, or Report text last load etc.
    best regards,
    kai

  • How can I get the Elapsed Time express to output in milliseconds?

    I am trying to get the Elapsed Time express to output in milliseconds or in seconds to three decimal places. I am pretty new at this.
    Thanks in advance!

    I'm not sure I understand your question. The output of the Elapsed Time Express VI is a DBL. It's already a floating point number. The default format for a numeric indicator is 6 digits of precision. You can change this in the properties for the indicator.
    To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
    Attachments:
    Example_VI.png ‏4 KB

  • How can I get the current time in Xcelsius?

    I'm reading in an XML feed containing dates/times, and I'd like to do a calculation to see how old it is -- but I can't seem to access the current time in Xcelsius (=now() doesn't work -- it only calculates once, when the model is loaded).
    I can get around that (a bit awkwardly) with a timer, but I'd also like to know what the user's current time zone is... Any ideas?

    Hi,
    Maybe you could use a web service to return the required information - you can feed the timezone to the web service.
    Have a look at this:
    http://www.earthtools.org/webservices.htm#timezone
    http://markitup.com/WebServices/TimeZones.asmx?op=CurrentDateTime
    Best regards,
    Jacob

  • How can I get the logoff time of each db user from system view?

    I can get the logon_date from gv$session.
    Now,I want to get the logoff_date from some view or table.
    I know that I will get it with trigger.
    But,I am not will to user trigger for it.
    Who can tell me which view or table will show the info?

    But,I am not will to user trigger for it.Are you saying you are not willing to fire a trigger to gather this information?
    I don't know of a table, if one exists, someone will know.
    I say until you find a table, just write a SYSTEM TRIGGER on LOGOUT and place this information in your own table.
    Eric

  • How can I limit the run time of my VI so that it starts when the arrow is clicked, and stops automatically when a specified time has elapsed using Labview 7?

    I can't seem to find the proper tools to do this. Any help would be greatly appreciated. Thanks in advance.

    I'm guessing that you're running something in a While loop, so you should be able to stop whenever you want.
    In LabVIEW 7, there is a new Express VI on the Time & Dialg palette named Elapsed Time. You specify the time you want, and it generates a boolean True after that amount of time has passed. Just connect this boolean to the Wile loops conditional terminal, either directly or "OR" it with a stop button so you can stop it yourself if needed.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • I purchased a magazine using the Zinio app which I'd recently downloaded on to a recently purchased iPad. I received an error message at the time (can't recall the details) but have since been invoiced for the $8.99. How can I get the Magazine I purchased

    I purchased a magazine using the Zinio app which I'd recently downloaded on to a recently purchased iPad. I received an error message at the time (can't recall the details) but have since been invoiced for the $8.99. How can I get the Magazine I purchased?

    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
    Canceling a Digital Subscription
    http://gadgetwise.blogs.nytimes.com/2011/10/14/qa-canceling-a-digital-subscripti on/
     Cheers, Tom

  • HT204053 If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad

    If I have an apple ID for myself and my wife has just got a iPhone for the first time how can she get the same apps as I have for my iPhone and iPad by getting it off my iCloud?

    She can't from iCloud without setting up your iCloud account on her phone. But just sync the same apps from your iTunes Library on your computer to her phone.
    Your wife should setup her own iCloud account - which is separate to the iTunes Store accounts.

Maybe you are looking for

  • External speakers won't work

    The only time I can listen to music is through my Bluetooth. The external speakers don't work on my 4s. I have to start playing the song and in the lower right hand corner of iTunes it give me the option to switch between my Bluetooth or Dock Connect

  • Video playback in on SonyEricsson phone

    Hi, I want to add video playback to my application. To get familar with the J2ME player, I tried the MMADemos in the WTK 2.2. They work on my S700i, but I can`t play videos! I've tried MPEG1, MPEG4 and 3GPP files, but I always get the following error

  • Output Type ZNEU not coming as default

    Dear Al, I have configured for output type ZNEU for PO printout.By entering manually znue in the message I can able to take printout. But I want to get ZNEU as default once I create PO. I have maintained condition also. Any tips?  please With Regards

  • Select Dynamic for Select Option

    Hi. Good Night. I have the following screen of selection for a user. I need create a Select Dynamic for the table ANLA, Having in count the values selected by the user in each option of the screen. SELECTION-SCREEN BEGIN OF BLOCK SEL WITH FRAME TITLE

  • 2nd gen Time Capsule max capacity

    Hi, I 've previously upgraded my 2nd generation Time Capsule (A1302) with a 2TB hard drive. I'd like to make a second upgrade with a bigger hard drive but I don't know if this model is able to accept a 3TB or bigger hard drive. I'm also wondering if