Results 1 to 2 of 2
  1. #1
    bodyady is offline Member
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Default Netbeans runs better than compiled file

    Hi everyone, i have an issue with a "game" i'm making...
    The game have a graphical interface builded with canvas, it has 2 threads, and both have something like:

    Java Code:
    long startTime,endTime,Timeslice=40;
    
    while(true){
    
       startTime=System.currentTimeMillis();
       doStuff();
       endTime=System.currentTimeMillis();
       
       Thread.sleep(Math.max(timeSlice + startTime - endTime, 0));
    
    }
    My problem is that when i run it in netbeans the average milliseconds the game uses to "render" is 25. But when i build and run the jar file the average time to render is even more than 80...

    So the game runs perfectly with netbeans but the jar runs verry badly.

  2. #2
    sabre150 is offline Member
    Join Date
    Jul 2012
    Location
    Earth
    Posts
    75
    Rep Power
    0

    Default Re: Netbeans runs better than compiled file

    Ouch - that looks to be an extremely ugly and inaccurate approach. Since you are using Canvas I suspect you are not using Swing and should be using a java.util.Timer and calling the doStuff() in the actionPerformed() method.

Similar Threads

  1. Replies: 0
    Last Post: 07-21-2011, 10:06 AM
  2. project runs in netbeans but .jar wont work
    By Zeo7 in forum New To Java
    Replies: 3
    Last Post: 12-16-2010, 04:21 PM
  3. Jar file wont run but runs in netbeans
    By ArmenBaba in forum NetBeans
    Replies: 14
    Last Post: 08-24-2010, 05:04 PM
  4. Opening file, runs in NetBeans but CommandPrompt
    By fauzilhaqqi in forum NetBeans
    Replies: 2
    Last Post: 12-15-2008, 03:48 AM
  5. Program Runs in NetBEans but Not in cmd
    By MeathUltra in forum NetBeans
    Replies: 1
    Last Post: 12-09-2008, 05:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •