Help on testing algorithm time

Hello everybody:
I want to ask a question about testing algorithm time.
In my program, I always got the encryption time is zero. And some times is 15ms or 16ms. I test the time like this (ignore the unnecessary part):
long startTime = TimeCounter.startTime();
//generate a key by according algorithm
SecretKey key = KeyGenerator.getInstance(algorithm).generateKey();
Encryption encrypter = new Encryption(key);
encrypter.encrypt(si);
SecretInformation decrypted = encrypter.decrypt();
System.out.println(TimeCounter.period(startTime));
System.out.println(key);
System.out.println(startTime);
System.out.println(System.currentTimeMillis());
Could you point out the problem? Thank you very much.

But If I test in a loop ,,the result is not the
algorithm time?Why not! If you repeat the same operation 10,000 times and time the total then it is a simple matter to work out how long (on average) a single operation took!

Similar Messages

  • 7 Hours left :(! I hate Java Forte SO MUCH. Please help! Not much time

    7 Hours left :(! I hate Java Forte SO MUCH. Please help! Not much time
    Ok I first Installed Java Forte cause I had to a Course and the teacher gave us an Exe which was 62 MB on a Disc and i ran it and put Java Forte On My Computer. I also put a JDK program on my computer through a Java book(Got a CD with it).I could do my Java at home but there was a massive problem. I am using Windows XP and if i used java, My Computer would never shut down cause java would always be running. So this got frustrating and i decided to uninstall it.(Also the Java Plug in decided to stop my java Yahoo chat on IE).When i uninstalled it, I am not sure if i deleted the folder, Did it through control panel(Add/Remove), Or use the uninstaller, I didnt think there was an uninstaller.
    Anyway there was still some jc.java and java Web Start folders and J2SDK folder on my HDD.
    A while later I get a big Java Assignment to do, I decide to install the Java again on my Computer, I go ahead and click the exe, It takes me to an intall place, I wait, Wait impatiently for 1 hour, It just froze on the install screen. I also tryed it on my old PC which had java, It froze But before it frose it said i already had it installed (Which it wasnt anymore). So i though maybe its the CD or something. So my friend gives me his CD and i try, Yet again it stayed like that for 2 hours. I was so frustrated. I ended up Going to control panel and removed the java Web Start and deleted the J2sdk FOlder and deleted the java Plug in from where it locates it.
    I then decide to install Java again but this time it takes me to the uninstaller? Why did it try to install from this exe but after i deleted stuff both CD's Mine and my Friends take to to the uninstaller? Well anyway i decided to Uninstall it like it said"Java Forte 3 and Some other little thing" Then i waited and it said Uninstall Complete. I double click the exe on the CD again and it takes me to the uninstaller again? I was like WTF? How do i install Java? Its just the biggest pain? Why is it taking me there instead of the actuall installer?
    Also I dislike other java programs as 1, You cant Execute the code cause its only HTML compatible and or you need the JDK files accosiated with the JCreator which i cant Understand.
    Also i got Jreal and it actually worked, But there is no uninstaller for it and it has no Removeal in the Control panel? Whats up with that? Also its good how it works. But for some reason it doesnt accept the code properly as the buttons and labels just appear everywhere and stay there even if i change forms and are messed up compared to when i run it on Java Forte at School.
    Also i have a Major Problem with Jreal as it states everytime i run an Applet "Start Applet is not Initialized?" And it shows a Blank applet? Whats up with this? I got no Errors and i think it said Exit Statement:1. But It worked before then i tryed it and it does this all the time for all my Java Program Applets. So I have no idea. It really frustrates me as it was working and i did no changes to the code and it wont let me test any more :(! Why is this happenning to me?
    Please help me in the best way you can, I dont have much time, 7 Hours to be Precise to do it in!
    Please if you can help me with any problems about installing or evening trying to be able to run Jcreator(Dont understand How to link it with JDK) or any good Java Programs to download that are easy to use(I dont have enough time to read). I couldnt understand CoffeeCup as it was HTML only? and only could run as a Web Page! But any help on Any of these problems that i suffer including Jreal How to Uninstall? Plus Mainly trying to get Java Forte Runnign as that was the only one that was properly showed the correct format of my Coding Applet.

    Awww :(

  • Please help with LRU algorithm....

    I need some help finding an algorithm to achieve the Least Recently Used (LRU) paradigm in memory swapping... Please assist if you have anything to achieve this.... Does java put a timestamp on an item placed in memory?... if so how do I reference this stamp... please assist.... Thanks in advance....
    Blackaxeman.....

    Does java put a timestamp on an item placed in memory?No, it doesn't. If you want to keep track of which object were most recently used, you have to do that yourself. Of course you could only do that with objects that had code built in to track usage. That wouldn't be too difficult for properly encapsulated classes. And as grimlock81 says, you don't need a timestamp. Keeping a list and adding the object to the front of the list every time it is used is sufficient.

  • Help with SimpleDateFormat and time

    Hi,
    I have a strange result when formating a time!
    Time test = new Time(0);
    DateFormat df = new SimpleDateFormat("HH:mm:ss");
    System.out.println("my date: "+ df.format(test));
    Result is 01:00:00
    Why is this not 00:00:00
    Thanks in advance,
    Pieter

    A Date object represents a moment in time, which can have different textual representations. A Date is represented in Java by a number of milliseconds counted from a fixed moment in time: 00:00 UTC on January 1, 1970 AD (using the Gregorian Calendar), which is the same as 01:00 CET. If that is not the time you mean, you should create a date with a different number of milliseconds (or better yet: use the Calendar class to specify the exact date, time and timezone you mean).
    It doesn't matter what timezone the server is set to or what timezone anything is set to, the Date still represents the same moment in time. The only time it matters is when you want to output a Date for a human to read. If you want everyone to just see the same numbers, explicitly set the timezone on your DateFormat to something fixed (I recommend "UTC" over anything else). Just make sure everyone understands which timezone you use.
    Storing the time as seconds will not help - it already stored as (milli)seconds anyway - nor will any other kind of converter: (Simple)DateFormat already has the capabilities to "convert" Strings to and from Date objects (note that using a DateFormat does NOT change the date in any way, it just displays/parses the date in an appropriate format/timezone).

  • Problems with my Mobo - Hangs at "Testing Real Time Clock" - Whats up?

    Specs:
    MSI K7 Master - MS-6341
    AthlonXP 1800+
    512 PC2100 DDR
    40 gig Maxtor or Seagate 7200rpm, 2mb cache - tried both
    Pine 56x CD Rom
    eVGA GeforceFX 5200
    Generic 420watt PS AND Antec TruePower 430 watt PS - same results
    Alright, I can access the BIOS, etc. but after the first startup screen (with ram, processor type, IDE config, etc.) the screen just has a underscore blinking at the top left...and the error system says Testing Real Time Clock - Ive basically narrowed it down to the IDE connectors since I can unplug the hard drives and it gets past that section and asks for a boot drive - anyone have similar problems? I know he board is old but its for the family and Im stuck right now and I got some anxious members of my family wanting to know whats up with the system - any help will be appreciated...
    It should be noted that I was able to install/run Windows for a couple of days - then I got stability problems which was from the BIOS overclocking my ram past spec but I fixed that and Windows was fine but now I cant boot back up and it cant be virus or bad hard drive because Ive tried more than one - some people who also have this problem can sometimes boot to their OS but its usually not the case...thanks again for the suggestions..
    Things Ive Tried:
    Replaced the CMOS battery
    Cleared CMOS
    Change IDE channels
    Tried just the hard drive
    Removed jumper from hard drive
    Cleared CMOS
    Reseated the ram
    Reseated Video card
    Cleared CMOS
    If someone can find a working solution for this, Ill give them something in return - like some DVDs or cash or something, I really need some help..
    - Adam/vicks

    No problems with the mobo physically - I got it new from a trusted guy on some forums I goto (anandtech) new from an RMA - still sealed...
    I have it running....again....it doesnt like that 1st IDE channel for some reason - Ive restarted/rebooted a few times and nothing has happened so hopefully its fixed but still not cool - Im almost 100% sure it will happen again...

  • For some reason I cannot download and install the latest version of iTunes. 11.0.2. Could you help please? Each time I try, I get a command box saying 'The feature you are trying to download is on a network resource that is unavailable. Click Ok to try ag

    For some reason I cannot download and install the latest version of iTunes. 11.0.2. Could you help please? Each time I try, I get a command box saying 'The feature you are trying to download is on a network resource that is unavailable. Click Ok to try again or enter an alternate path to a folder containing the installation package iTunes.ms in the box below.
    Please help!
    Many thanks in advance
    Ben Bentley
    West Midlands
    UK

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • TS4268 I need help getting my face time and imessage to work.

    I need help getting my face time and imessage to work. It is saying wating for activation. I just got my iphone 5 2 days ago. I have reset it from the phone and from itunes on the computer, made sure I'm attached to wifi.

    The 3 basic troubleshooting steps are these in order: 1. Restart your iphone  2.  Reset your settings/iphone  3.  Restore your iphone.  Since your iphone is only a couple of days old, you should backup your device before restoring.  If you don't have anything on your iphone that you care to lose, then simply restoring without a backup is fine.  A quick reset of pressing the sleep/wake button (top of iphone) and your home button simultaneously and holding it until the silver Apple logo appears. 

  • Could anyone help me test about 'Thai' language support

    Hi, I would like to ask anyone who owned new iPod touch to help me test if its support Thai language for web browsing and audio files.
    Please open this website / play this audio files and take some photos for me.
    http://manager.co.th (this page should all in Thai)
    http://zickr.com (also in Thai, but with utf-8 encoding)
    http://download.yousendit.com/108FB2EB0D2E6427 (this m4a file contains Thai song title, I would like to check if its display in new touch correctly)
    Thanks a lot!

    To leave your comments and feedback for suture enhancements to the ipod touch it is best to leave your feedback at the link below.
    http://www.apple.com/feedback/ipod.html
    That link is where apple will read your comments.
    GFF

  • Execution of Coded UI scripts with least possible test execution time in Windows7 Operating system using Visual Studio Test Agent 2010 without VS2010 installed

    Hi All,
    We are trying to execute coded UI scripts without Visual Studio installed. We are using “Visual Studio Test Agent 2010” for executing coded UI scripts without VS2010 in Windows 7, it is working fine. Also we verified executing the same script with VS2010
    Premium, it works fine as well.
    Here the challenge we are facing is with the Test execution time.
    When we run the coded UI script with IE11-Windows 7 OS-Visual Studio 2010 Premium it takes
    3min 36sec to complete the execution whereas with IE11-Windows 7 OS-Visual Studio Test Agent 2010  it takes
    6min 40sec for the same script to execute (which is almost double the time it takes while executing using VS2010).
    My question is what may be the reason for this difference? and how we can reduce the test execution time when running from Test Agent 2010?
    Kindly let us know what is the best practice to execute the coded UI scripts with least test execution time in Windows 7 Operating system using Visual Studio Test Agent 2010 without VS2010
    installed.
    Looking forward for your positive response.
    Thanks in advance..!!

    Tina-Shi, Thanks for the information.
    As you mentioned, we tried to execute the coded UI test using Mstest.exe in command on VS2010 Premium and checked on the execution
    time, there was a slight difference.
    Please find below execution time.
    Using Mstest.exe in command on VS2010 Premium/Win7 – 3.47 minutes
    Using VS2010 Premium/Win7 – 3.53 minutes
    Using Test Agent/Win7 – 7.3 minutes
    Also, I closed all the other processes in Task manager before starting up the execution.
    Still , I am facing the same Issue. Could you please suggest any other way to reduce the scripting time of coded UI script execution
    through Test agent 2010.
    Looking forward for your earliest response.

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • Please help to set the time zone in a porper way

    Dear Folks please help to set the time zone in a porper way
    select sessiontimezone from dual;
    Database: Oracle 11.2.0.2
    Operating system: AIX 5.3
    SESSIONTIMEZONE
    +00:00
    SQL> select systimestamp from dual;
    SYSTIMESTAMP
    06-NOV-12 04.21.07.438426 AM +00:00
    SQL> select dbtimezone from dual;
    DBTIME
    +00:00
    SQL> Select DBMS_SCHEDULER.get_sys_time_zone_name from dual;
    GET_SYS_TIME_ZONE_NAME
    Asia/Kuala_Lumpur
    By looking Doc ID: Note:149120.1 in Metalink:
    ALTER DATABASE <my db name> SET TIME_ZONE = 'Asia/Kuala_Lumpur'
    or
    ALTER DATABASE <my db name> SET TIME_ZONE = '+08:00'
    For reflecting the change I refreshed the db by shutdown and restart.
    but still the returning no timezone value for user schema, please help how to set the time zone in a proper way?

    SQL> conn sys/sys as sysdba
    Connected.
    DBNAME
    db
    SQL> select u.name || '.' || o.name || '.' || c.name "Col TSLTZ"
      2    from sys.obj$ o, sys.col$ c, sys.user$ u
      3   where c.type# = 231
      4     and o.obj# = c.obj#
      5     and u.user# = o.owner#;
    no rows selected
    SQL>  select DBTIMEZONE from dual;
    DBTIME
    +00:00
    SQL> alter database set time_zone='Asia/Kuala_Lumpur';
    Database altered.
    SQL> select DBTIMEZONE from dual;
    DBTIME
    +00:00
    SQL> startup force;
    ORACLE instance started.
    Total System Global Area  426852352 bytes
    Fixed Size                  1375060 bytes
    Variable Size             260048044 bytes
    Database Buffers          159383552 bytes
    Redo Buffers                6045696 bytes
    Database mounted.
    Database opened.
    SQL> select DBTIMEZONE from dual;
    DBTIMEZONE
    Asia/Kuala_LumpurRefer:
    Re: how to check db time zone
    Edited by: Ora on 5 Nov, 2012 11:36 PM

  • HT204380 help. tried for first time to use FaceTime with another iPhone user & it would not work. "FaceTime failed". we are both on wi-fi networks & iTunes accounts are set up correctly.

    help. tried for first time to use FaceTime with another iPhone user &amp; call refused to connect. Call would dial, allow us to accept call, then error message "FaceTime failed" would appear &amp; call disconnect. we are both on wi-fi networks, both phones have updated software &amp; both enabled FaceTime with iTunes logged in. don't know what else to do to get FaceTime to connect. Someone please help.

    Thanks Helen for the response. At least you can get some of the contacts to work. Absolutely none of mine will. Feel like my phone is cheating me out something it should do. Think I'm going to just have to dump all the Apple products in general because this phone hasn't worked right since I got it.

  • Testing Lead Time Scenario

    Hi gurus,
    I'm after some suggestions as to how to configure the following scenario in our make to stock PP-PI environment.
    Our process orders have a standard production rate for production of a batch of pieces.  I.e. 600 pc per hour.  The pieces are recieved into QI stock and then samples are sent to the lab.  The testing lead time is usually 24 hours but for every 10th batch the samples are sent off site and the lead time changes to 2 weeks.  We need to make sure that we schedule the start of the planned/process order to take into account the different post production testing lead time.
    Thanks,
    Ros

    Hi,
    In Planned Order and production order, there is facility to change Floats in Schedule Margin Key manually. Even u can chage SMK maually.
    so Make 2 SMKs and use according to the purpose.
    Kiran.

  • Can anyone help please with my Time Machine, I have been getting the following message The backup disk image "/Volumes/Mac Backup/Stephen Smith's iMac.sparsebundle" is already in use.

    Can anyone help please with my Time Machine, I have been getting the following message The backup disk image “/Volumes/Mac Backup/Stephen Smith’s iMac.sparsebundle” is already in use.

    See > http://pondini.org/TM/C12.html

  • Time manageru2019s workplace -No possible entries help available for this time

    Hello Experts,
    I am configuring time manageru2019s workplace.
    I can insert an employee , I can see his detail, planed schedule of time, but I cant change its TIME ID it is showing there like ?03 ( No possible entries help available for this time data ID )
    I have configured Time IDs also accordingly.
    I used definition set SET_BE
    And subsets P,Q,R
    I created time data IDs A- Absence ,B- Avilability ,U-Leave
    Please let me know where I am going wrong.
    Thanks and Regards
    Jaydeep Jadhav

    Hi,<br>
    Recheck all the nodes under TM->TMW. If you have maintained groups , please check them.
    Also request the abaper to debug and find which query is failing.
    Good luck<br><br>
    Thanks,
    Amosha
    <br><br>"Known is a drop & unknown is an OCEAN!"

Maybe you are looking for

  • Mac book trouble connecting to wifi

    My router was old and we received a new one.  My mac book used to recognize my router and now will not connect.  All the other devices now connect to the new router except the laptop.  Is there something special that I need to do?

  • How to Identify an whether an Sales order is created through EDI Idoc

    Hi all, By seeing an Sales Order, How to identify whether the sales order is created through EDI Idoc or by other source. Thanks in advance Regards Chakri

  • Cold Fusion Developer on Intel Mac

    I just ordered an Intel Mac....will I be able to install cold fusion on it for development? I saw the system requirements posted on the site were for Power PC processors. So I was just curious if anyone has successfully used cf with Intel yet; withou

  • Windows Update KB3023607 Wireless Problems

    Since the release of the microsoft update 3023607 our clients cannot connect to our wireless.  I did some research and see this update is affecting cisco VPN, but I cannot find any information about wireless connectivity.   Our environment consists o

  • Change the DN in the keystore

    Hi SDN, I tried to change the DN=<SID>. But there seems to be no way in SAP Visual Administrator > Service > keystore neither in the Portal itself. I am able to see the values,  but can not change them. Has anyone an idea? Best Regards, Olaf Reiss