How to use the System.nanoTime() ?

I've got a big trouble. I need to create a class with a lot of methods, each method does something, like draw squares, circles, calculate Fibonacci series, and so on. But the problem is:
1 - I need to use System.nanoTime() to calculate the time each method takes to execute and finalize its problem and compare to the time of the other methods.
Any sugestions?
Apreciate your help.
Thanks.

Yeah, sounded too simple, but I'm still wrapped. Could you please show me some code, where I have a method and the System.nanoTime() calculates the time this method takes to execute? It would be great if the method tha uses System.nanoTime() would be a abstract method, so I could use it in other methods for calculating their execution time...
Thanks a lot!

Similar Messages

  • How to use the SYSTEM user in hana cloud

    Hello guys, I started with HANA cloud trial, but I havent been able to activate any projects due to an error with permissions,
    Repository operation failed
    Repository request failed. Cause: Repository: User is not authorized to execute specified operation;User 'DEV_7UKVVFEAC54C2E59OZZQSHXEN' has no authorization, privilege: 'REPO.EDIT_IMPORTED_OBJECTS', package: 'hello'!, code: 40,156, argument:
    Now I believe the problem is obvious is that I dont have enough privileges, I went to the Users view and tried to add permissions to my user but I found out other error:
    SAP DBTech JDBC: [7]: feature not supported: grantor and grantee are identical
    Now I saw in several threads that if we want to add more privileges we should add them using SYSTEM user, but I just dont know how to log in with the SYSTEM user or how to switch to that user.
    Any ideas or steps on how to do it?
    Greetings!

    I just tried performing the exact same steps as described in the tutorial and I can confirm that I get the same error. I get the same error from the Web IDE when trying to activate folders created via the sharing wizard of the Studio.
    The problem would seem to be with the Studio version that is currently available from the HANA Tools update site.  When packages are created from the project explorer (either directly or through project sharing), they are marked incorrectly as foreign projects (the little blue arrow on the icon).
    However if you create the packages via the Content folder of the Systems view (as I did above for the hello package) or via the Web IDE; they are created correctly. I was able to setup a project in the Studio by pre-creating the package in such a way and then creating/sharing the project into the existing package.  I still got an error on the .settings sub-folder, but I could ignore it and still activate the other objects.
    Therefore I would suggest this approach or using the Web IDE.

  • How to use the system recovery after add another SSD?

    Dear all,
    I got a Zbook14 with 1TB HDD with Windows 7 in default. Soon after I received it, I added an M.2 256Gb SSD and migrated my system drive to the SSD. 
    After an malfunction of the HP Client Security that encrypted my system drive (in SSD). I used the HP recovery tool to reset the computer into the default factory status... This action, which I can not select the harddrive during the recovery, wiped my oroginal system paratation (now the data drive) in the 1TB HDD, and thus I have to migrate the system again (not mentioning the data in that partation..).
    I wonder if I can change the target drive for the recovery? I did not move the original HP partations from the HDD to SSD. Only the system partation is moved to SSD.
    Thanks. 

    You don't have any option in terms of changing the target drive for an HP recovery performed by the HP recovery manager.
    It is scripted and there is nothing that you as the user can change other than selecting the type of recovery desired.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • I don't understand how to use the System Font Panel with iMovie.

    I need an explanation of how the System Font Panel works. I guess there's a way to get some of those fonts to the iMovie Font Panel, but I can't see how.
    Thank you.

    I have had good success with the System Font Panel. Now all of a sudden, I only get part of it. Any suggestions on how to restore the entire panel? There are no change size options in the corners like in some dialog boxes. I was going to paste what I have here, but for some reason, paste is not available.

  • Satellite P105-S6197: How to use the system recovery disc

    Greetings,
    I have a P105-S6197 and I have followed the instructions on the recovery disc,
    1. Place the disc or #1 disc into the drive.
    2. Power up the computer while holding down the "C" key (release the "C" key when the screen reads "Toshiba")
    but these instructions do not work the computer just boots up normally and never runs the disc.
    Is there another way to get the disc to run so that I can completely reformat my computer to the way it was when it was first purchased.
    Thanks, Edana

    I can provide the same information like kody:
    There are different options to enable the booting from the CD/DVD drive.
    The first one is pressing the C button (you should press it several times) immediately after notebook was powered up.
    The second possibility could be the F12 button.
    This would enable the boot menu on the screen and then you could choose the CD/DVD drive as a boot device.
    Last but not least you could change the booting order in the BIOS.
    Set the CD/DVD drive (ODD) at the first place and the notebook should boot from the inserted, bootable CD automatically.
    Regards

  • HT201250 I had to replace the hard drive in my old MacBook. I replaced it. Installed OSX10.6. Then using the system software I reinstalled data from my Time Machine backup. On completion it asked for my password. It is not accepted. I am locked out how I

    I had to replace the hard drive in my old MacBook. I replaced it. Installed OSX10.6. Then using the system software I reinstalled data from my Time Machine backup. On completion it asked for my password. It is not accepted. I am locked out how I overcome this?
    I was already using 10.7. But only had the disc for 10.6.

    Sorry I am new to this. Am I in the right area? I am using my iPhone to make contact. I am worried.

  • How to retrieve the system used in an iview?

    hello,
    i'm currently having trouble retrieving the proper attribute of an iview to retrieve the system used by it.
    it seem like the strings identifying the system in the iview differ in some iviews.
    using either:
    myIView.getAttribute(IAttriView.PORTAL_SYSTEM)
    or
    myContext.getAttributes("").get("System").get().toString()
    produce errors.
    while get("System") sometimes provides the correct system alias the attribute is none existant for other iviews where the string would be "Systemalias".
    IAttriView.PORTAL_SYSTEM doesn't seem to work at all.
    i did implement fail safe code if the attribute isn't present, however i don't know how to retrieve the system attribute without doing a case switch or something similar for all the different strings, which i would prefer not to do.
    also, is there an easy way to retrieve all iviews which use a specific system without parsing the whole pcd and checking the attributes?

    Prerequisite : Create the System Alias for the systems used in the application.
    Use the below code to retrieve the system details:
            HashMap mapattr = new HashMap();
            HashMap map = new HashMap();
            IUser user = WDClientUser.getCurrentUser().getSAPUser();
            IPrincipal principal = (IPrincipal)user;
            ArrayList list = UMFactory.getSystemLandscapeWrappers();
            ISystemLandscapeWrapper systemLandscape = (ISystemLandscapeWrapper)list.get(0);
            //Portal System ALias name
            ISystemLandscapeObject landScapeObject = systemLandscape.getSystemByAlias("<system alias name>");
            IUserMappingData userMapping = (IUserMappingData) UMFactory.getUserMapping().getUserMappingData(landScapeObject,principal);
            userMapping.enrich(map);
            mappedUserId = map.get("user").toString(); // String "UserId"
            mappedPassword = map.get("mappedpassword").toString(); //String "Password" 
         catch(Exception e)
              e.printStackTrace();
              wdComponentAPI.getMessageManager().reportException("Exception during retrieving the User Details - " + e.getMessage(),true);
    Thanks & Regards,
    Amar Bhagat Challa

  • Splash screen says "System extension cannot be used  The system extension "/System/Library/Extensions/PulseDriver.kext" was installed improperly and cannot be used. Please try reinstalling it, or contact the product's vendor for an update.  How to fix?

    Please help!
    After installing iTunes 11.0.1 I got a splash screen that appears after all updates.  The screen reads:
    System extension cannot be used
    "The system extension “/System/Library/Extensions/PulseDriver.kext” was installed improperly and cannot be used. Please try reinstalling it, or contact the product’s vendor for an update."
    Question: How do I re-install or replace this file?
    Jim

    I submitted the above question, later finding that it has been answered by Buller already.  No one need reply as Buller's answer seems to solve the problem for others, and I'll try that.
    Jim

  • How can I use the system clock.

    My java program need to use the system clock to initiate some functions. Is there a method to do this or do I need to create one ??
    Any help appreciated.

    The following article will likely contain information useful to you:
    Working in Java time: Learn the basics of calculating elapsed time in Java

  • How to Use the same iview for both KM End User and the KM Administrator

    Hi friends,
    *This is my scenario :* How to Use the same iview for both KM End User and the KM Administrator but with different Context
    Menu Options.
    i followed these steps but im getting same context menu for both KM End User and the KM Administrator .
    Assign the role Content Administrator to the user km_admin. This is needed so that km_admin can change
    the presentation settings for the KM Folder u201EReports_kmFolder‟.
    Now, login with user km_admin. Navigate to the Km Folder reports_kmFolder through Content Administration
    -> Km Content. Click on Details link of the folder reports_kmFolder.
    Go To Settings -> Presentation. Click on the tab u201ESettings for You‟-> Click on button u201ESelect Profile‟.
    Select the radio button corresponding to u201Elayout Set‟, and choose u201EConsumerExplorer‟ from the dropdown.
    Click u201EOK‟.
    Select both the check boxes corresponding to Items Affected as shown above, and click u201ESave‟
    Now, remove the u201ESuper Administrator‟ role from the user km_admin and login with this user.
    How rto resolve this????
    Regards,
    Prasad.

    Hello Prasad,
    Most likely the user km_admin still has system principal roles assigned, even though you removed the Super Admin role, you should check that this user doesn't have any other admin roles, otherwise it will be considered a System Principal user and will therefore still have access to all content. For more information see http://help.sap.com/saphelp_nw70/helpdata/en/19/56f28fbd4e11d5993b00508b6b8b11/frameset.htm
    Try creating a new user with just read access to the content and you should see that it will not be able to make any changes etc.
    Regards,
    Lorcan.

  • How to use the second display for installation OS in my vertical lines iMac

    My 17" iMac display is full of vertical lines, it is unuseable. Does anyone know how to use the second display for Mac OS X or disable the first display for installation Mac OS x ?

    Go to: *System Preferences > Displays* and select the Arrangement tab, then relocate your Menu bar by dragging it to the other display.
    Unfortunately there is no Hardware or Software switch to turn off the iMac's Internal Display.

  • How to use the CMS functionality in Sun Portal Server 7.2

    Hi All,
    How to use the CMS functionality using the ccd.war(Portlet) which is available in the library as i could add it to my channel but not able to show the functionality as it is showing the error msg "You are currently not logged in. Please login." should I create userid and there respective roles inorder to use the CMS functionality.
    Has any one used this as I could this in glass fish server.
    Any Input is appreciated.
    Thanks & regards
    Srikanth

    Have a look at the "*Roles*" section of the portal server 7.2 content management system guide
    http://docs.sun.com/source/820-4275/index.html . You can also look at [project mirage|https://mirage.dev.java.net] for some screencasts
    Alternatively,
    1. ccd.war has 3 portlets in it:
    (a) custom content definition portlet
    (b) custom content portlet
    (c) workflow portlet
    2. Inorder to work with these portlets, user needs to be in anyone of the below roles:
    (a)Consumer (b) Editor (c) Approver (d) Administrator (e) Submitter (f) Contributor (g) Publisher
    3. By default ccd.war gets deployed using a default roles file (/var/opt/SUNWportal/tmp/ccd.roles.properties)
    Note: In windows, you may not find this file
    4. Access the portlets as a user in any of the role mentioned in the ccd.roles.properties
    (OR)
    you can use a new roles file which has mapping to your custom roles. For this , undeploy existing ccd.war and deploy again with a new roles.properties file
    Hope this helps!

  • How to use the "out" parameter in idl

    hello.idl:
    module HelloApp
    interface Hello
    string sayHello();
    void getPass(in string name,out string pass);
    HelloServer:
    public class HelloServer
    class HelloServant extends _HelloImplBase
    public void getPass(String name,org.omg.CORBA.StringHolder pass)
    System.out.println("Server pass = " + pass);
    if (name.equals("lxh"))
    pass = new org.omg.CORBA.StringHolder("1234");
    if (name.equals("cbj"))
    pass = new org.omg.CORBA.StringHolder("5678");
    HelloClient:
    public class HelloClient
    public static void main(String args[])
    try{
    org.omg.CORBA.StringHolder Pass = null;
    if (args.length == 1)
    System.out.println("Client pass = " + args[0]);
    helloRef.getPass(args[0],Pass);
    System.out.println(Pass);
    } catch(Exception e) {
    When I run client main method with parameter "lxh",I will get a error says the getPass() parameter which has given is wrong.
    How to use the out parameter in client?

    Does this error only occurs if you pass "lxh" or always?
    Did you try passing a StringHolder Object rather than a NULL Object?
    Perhaps you can post the error message!?

  • How to use the selection profile and status profile for production order?

    Hi expert,
       I want to know how to use the selection profile and status profile for production order. what's the usage for these two selection profile and status profile ?
      Please help me.
      thanks in advance.
      george.shi

    Hi George,
    There are are two types of statuses.One is system status and second one is user status.These statuses will tell us current situation of an order.
    We can't change system statuses.But we can create our own statuses through status profile.With this profile we can control user statuses.
    In this status profile,
    1.We define the sequence in which user statuses can be activated,
    2.We define initial statuses
    3. Allow or prohibit certain business transactions.
    Selection profiles are used to select the objects (say production orders) with different status combinations.We assign status profiles to selection profiles in BS42 T-Code.
    Regards,
    Raja.
    Edited by: Rajarao on Oct 30, 2008 6:21 AM
    Edited by: Rajarao on Oct 30, 2008 6:22 AM

  • How to Use a System Repair Disc to Restore Windows 7

    Hi ! Please start here!
    http://www.dummies.com/how-to/content/how-to-use-a-system-repair-disc-to-restore-windows.html
    http://forums.toshiba.com/t5/Computer-Troubleshooting/What-can-I-do-if-my-Windows-7-or-Windows-Vista...
    http://forums.toshiba.com/t5/Windows-8-Knowledge-Base/What-can-I-do-if-my-Windows-8-laptop-won-t-sta...
    http://pcsupport.about.com/od/toolsofthetrade/ss/windows-7-startup-repair_2.htm
    PS Please read all these links and then post back here with your complete model number found on the bottom of your laptop and complete information to what you have tried to get your PC working I would love to spoon feed everyone. It's just not possible.
    Dokie!!
    PS2 Now read this and see if any thing here helps.
    http://forums.toshiba.com/t5/Computer-Troubleshooting/FYI-Recovery-to-Factory-Settings-Toshiba/td-p/...
    I Love my Satellite L775D-S7222 Laptop. Some days you're the windshield, Some days you're the bug. The Computer world is crazy. If you have answers to computer problems, pass them forward.
    Attachments:
    Capture40.JPG ‏238 KB

    Hi! I found this on the form!
    http://forums.toshiba.com/t5/System-Recovery-and-R​ecovery/How-To-Understanding-System-Recovery-Optio​...
    I Love my Satellite L775D-S7222 Laptop. Some days you're the windshield, Some days you're the bug. The Computer world is crazy. If you have answers to computer problems, pass them forward.

Maybe you are looking for

  • Getting the information from a harddrive

    My mother board burned up, so I had to buy a new computer,(tower only), however I havre lots of my business information on my old hard drive, which I did have a friend remoce from my old tower. When I called Staples to ask about buying a box to place

  • Migration from old MBA to new MBA.  Ethernet not coming up as an option, defaults to wifi

    Hello I'm using migration assistant to migrate all the data from my old MBA [Snow Leopard] to new MBA [Lion]. I've tried many times using different wireless connections and the process just hangs with 3 hrs, 50 mins left to run. Apple store bod advis

  • R9 270 2G driver issues

    this is just a quick question to find out if any one else is having the same issue and to find out if i can rectify it. i am the owner of an r9 270 2g OC  now i can install most drivers upto 14.2 beta, how ever the moment i install 14.3 or the new 14

  • Open in safari activity missing

    After upgrading to iOS 8.3 the "Open in Safari" activity is missing from the share sheet and is not available in the "more" list on my iPad mini. (It is still available on my iPhone 5s.) Is there a way to restore the "Open in Safari options?

  • Issuance (pack size) Qty and Minimum Lot Size

    Hi Experts, I have a problem, I have to maintain Minimum Lot Size and issuance (pack size) in the material master. Suppose Minimum Lot size of one material is 2000 and Pack size vendor provides is 400. Means, when we place order, minimum order can be