This assignment has 4 parts.
In this assignment you will write an applet to test the time resolution of
the Java virtual machine and the speed of a particular Java system call.
Note that we are using Java 1.1 and you may not use
any deprecated methods.
Turn in a copy of the source code for all parts of the assignment by the
start of class on the due date.
Do not destroy the source code for any assignment you have done for this
course until the course is over.
For each part that you get to work correctly you will put the class file
and an html file under your public_html directory and put a link to
execute the applet on your course web page.
The source code for your applets should not be public.
Put a copy of the class file where it can be accessed from your course web page
and put a link to it in your course web page.
The link should be labeled Assignment 2, Part 1 (TimeTest1).
Make sure you set the permissions so that
anyone can access it from a browser.
Part 2:
Copy TimeTest1.java to TimeTest2.java and modify it
as follows. The number to be entered should be an integer.
The integer represents the number of iterations in a loop.
If the value is n, then a push of the Start button causes
n+1 calls
to System.currentTimeMillis() to be put in consecutive
entries in an array. No other calculations should occur in this loop.
When the loop is done, create another array of size n which
will contain the differences between consecutive values of your first array.
The applet will then display various statistics
about this second array of n differences.
Instead of displaying one hundred times the number,
display the following information on separate lines in the following order
with the appropriate description.
Part 3:
Copy TimeTest2.java to TimeTest3.java and modify it
as follows.
Write a method for sorting an array of integers.
Create a third array which just contains the non-zero differences from the
second array. Use the count of the non-zero differences to allocate
an array of the correct size.
Sort this array and display the following additional information:
Note: You may use a simple order n-squared sort for this assignment.
Part 4:
Write a short report indicating which platforms you tested your applet under
and the summary of what you learned about the time resolution of the
System.currentTimeMillis() method under those platforms. Make a web
page with this information, print it out and hand it in with your source
code for the other three parts of the project. Put this report in your
web-accessible directory and make a link to it on your course web page,
but make the file readable only by you for now
(permissions rw-------).