|
||||||
|
Welcome to the TBCS Community Forums forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
|
|
Thread Tools |
|
#81
|
||||
|
||||
|
Can't wait!
__________________
Quote:
Projects: Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake Book Of Knowledge |
|
#82
|
||||
|
||||
|
And the results are in, honstly im suppurised at them.
And helix, your app didn't have a counter and you didn't reply with a revision that did so, in efect your app does not have any scores becuase i couldn't get any. ![]() |
|
#83
|
||||
|
||||
|
its strange i think, VB has 2 out of 5 victorys and Java has 2 out of 5, and C++ has only 1 out of 5.
I was expecting C++ to wipe the floor with everything, but apperently not! |
|
#84
|
||||
|
||||
|
so who won?
__________________
"At the midpoint on the journey of life, I found myself in a dark forest, for the clear path was lost..." -Dante Alighieri |
|
#85
|
||||
|
||||
|
Yeah, who won?
I can see that VB (my program ) wins in the shorter countings, but java (trace) takes over at the larger numbers. Also C++ (Mtekk) is quicker at those numbers.It seems to me that both Java and C++ count faster, but the program takes a little time to initialize or somthing, since the lower numbers all take about 15-16ms... Anyways, good job you all! now: let's see the sources ![]() |
|
#86
|
||||
|
||||
|
Quote:
I'd like to see the code silverdemon used. Mine is in the bottom of this post. Just out of curiosity, did you do multiple runs and average them? And what system specs? Here's my code Code:
/*
John Havlik
4-18-2008
Count Benchmark
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <ctime>
using namespace std;
int main()
{
clock_t start, end, elapsed;
vector
__________________
|
|
#87
|
||||
|
||||
|
Well, who won?
My code is below. I entered the second 1. If you want my VB6 code let me know.(PM) Java (with output): Code:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;
class Count2
{
public static void main(String args[]) throws FileNotFoundException
{
Scanner input = new Scanner( System.in );
PrintStream diskWriter = new PrintStream( "D:/java/numbers.txt" );
System.out.print( "Enter number to count to: " );
int countto = input.nextInt();
int count = 0;
long time = System.currentTimeMillis();
while (count < countto)
{
count = count + 1;
diskWriter.println( count );
}
long timeTook = System.currentTimeMillis() - time;
System.out.println("It took you "+timeTook+"ms to count to "+count);
}
}
Code:
import java.util.Scanner;
public class Count
{
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
System.out.print( "Enter number to count to: " );
int countto = input.nextInt();
int count = 0;
long time = System.currentTimeMillis();
while ( count < countto)
{
count = count + 1;
}
long timeTook = System.currentTimeMillis() - time;
System.out.println("It took you "+timeTook+"ms to count to "+count);
}
}
__________________
Quote:
Projects: Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake Book Of Knowledge |
|
#88
|
||||
|
||||
|
Just for fun I opened up Mathematica and did some plots of the times. For the following plots, orange is Trace, blue is me (mtekk), red is Silverdemon, and green is Prince.
Here's Trace's Time vs. Count graph ![]() Here's My Time vs. Count graph ![]() Here's Silverdemon's Time vs. Count graph ![]() Here's Prince's Time vs. Count graph ![]() Here is a combined, graph on the common axis of Prince's plot. ![]()
__________________
Last edited by mtekk : 04-27-2008 at 04:29 PM. Reason: Fixed the combined plot |
|
#89
|
||||
|
||||
|
Quote:
Unless I'm missing something ![]()
__________________
|
|
#90
|
||||
|
||||
|
Wait, I think that's the one I entered. I'm not completely sure actually.
__________________
Quote:
Projects: Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake Book Of Knowledge |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
thebestcasescenario.com













) wins in the shorter countings, but java (trace) takes over at the larger numbers. Also C++ (Mtekk) is quicker at those numbers.







Unless I'm missing something 
