Total members 11893 |It is currently Tue Nov 05, 2024 7:52 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Code:
import java.util.*;

public class 
CalculateProcessTime{
  public static 
void main(String[] args){
    
int repeat 2000;
    
double[] ds = {Double.MAX_VALUE, -3.14e-200DDouble.NEGATIVE_INFINITY567.89023D,
123e199D, -0.000456D, -1.234D1e55D};
    
long[] ls = {2283911683699007717L, -8007630872066909262L4536503365853551745L,
548519563869L45LLong.MAX_VALUE1L, -9999L7661314123L0L};
    
long time;
    
StringBuffer s = new StringBuffer();
    
Hashtable<Object,Object= new Hashtable<Object,Object>();
    
System.out.println("Starting test");
    
time System.currentTimeMillis();
    for(
int i repeat0i--){
      
s.setLength(0);
      for(
int j ds.length-1>= 0j--){
        
s.append(ds[j]);
        
h.put(new Double(ds[j]), Boolean.TRUE);
      }
      for(
int j ls.length-1>= 0j--){
        
s.append(ls[j]);
        
h.put(new Long(ls[j]), Boolean.FALSE);
      }
    }
    
time System.currentTimeMillis() - time;
    
System.out.println(" The test took " time " milliseconds");
  }


calculate the process time of the completion of the operation through the Java program. In this section, an example with the complete code of the program is given for the best illustration of the procedure of calculating the process time in which any type of operation is completed after whole processing.
8)



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Calculate process time
 calculate the load time for a page     -  
 code for FIFO schedualing process     -  
 process we can used complete and uncomplete method     -  
 Calculate euclidean distances     -  
 Calculate the sum of values in an array     -  
 calculate speed of a car in javaCV     -  
 Calculate score of the student     -  
 How to Calculate Volume of a Rectangle     -  
 calculate the total type of stocks     -  
 Calculate the area of a circle of given radius     -  



Topic Tags

Java Time






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com