[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Performance: C contra Ada



Michael Rasmussen wrote:

> On Tue, 02 Mar 2004 17:16:53 +0100, Jakob Oestergaard wrote:
>
> Ingen problemer her - det er jo udgivet under GPL:-)
> C++: http://tomcat.edu.brock.dk/dmu/csis3013/examples/fibonaci-c++.tar.gz
> Java:
> http://tomcat.edu.brock.dk/dmu/csis3013/examples/fibonaci-java.tar.gz
> 

Borde inte java koden se ut så här ?

class RecurThread extends Thread {
 .
 .
public void run()
{
        long iter;
        long start = System.currentTimeMillis();

// ???? for(iter = 0; iter < times; iter++)
// ????         doRec(iter);
        long res = doRec(times);  // ???????????
        System.err.println("Execution time for " + getName()
                        + " thread: " + (System.currentTimeMillis() - start)
                        + " msec." + res);
}


Det ser annars ut som du kör det rekursiva anropet times gånger,
istället för en gång. Men jag kanske skall hålla mig till språk jag begriper 
mig på :)

/Björn


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *