Page 3 of 12 FirstFirst 12345678 ... LastLast
Results 21 to 30 of 113

Thread: Counting

  1. #21
    Resident EE mtekk's Avatar
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    469

    Default Re: Counting

    Quote Originally Posted by crenn View Post
    Something doesn't quite seem right with that program.
    It's not doing anything in the loop so the java compiler does it's optimizing duty.
    Quote Originally Posted by xRyokenx View Post
    ...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

  2. #22
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    Oh, that could be it haha
    Like I said before, I just started today
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  3. #23
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: Counting

    Maybe I'll have to try my hand at this. Been working with Java for about a year and did some basic Python stuff before that. Haven't done anything with timers though, other than sleeping/waiting.

    Weazel, I think my professors would stab me if I handed in a program that looked like that. Readability, documentation, meaningful variables and such are high on their list. But wow. I am going to really have to take a look at that when I have more time. Looks like a very interesting approach.

  4. #24
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    Code:
    System.currentTimeMillis()
    Thats all you'll need to take a time
    One at the beginning and one at the end set in variables. Subtract the first variable from the second and you have your time in Milliseconds
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  5. #25
    Linux dabbler IndyRacer27's Avatar
    Join Date
    Apr 2007
    Location
    Northern Canada
    Posts
    253

    Default Re: Counting

    Quote Originally Posted by weazel6265 View Post

    Code:
    +00000000+++000000++++++0000++++++++000000+++++++++++++++++++++++++++++>
    ++++00++++++0+++++0++++0++++0++++++0++++++0+++++++++++++>
    ++++00++++++0+++++0+++0+++++++++++++0+>++++++++++[<<<
    ----00------000000----0--------------000-----------------------------[
    ++++00++++++0+++++0+++0+++++++++++++++++0+++++++++++++++++++++++>.<.>>.<<
    ----00------0-----0----0----0------------0----------------------]>+<
    ++++00++++++000000++++++0000++++++++00000+++++++++++++++++++++++>>>-]

    LMAO! It's a do-nothing machine. +rep
    My goal in life is to earn enough money to enjoy the lifestyle that my wife and kids do.

  6. #26
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Counting

    Quote Originally Posted by mtekk View Post
    It's not doing anything in the loop so the java compiler does it's optimizing duty.
    If we're going to talk about letting the compilers to optimize, 0 to 10,000,000,000 in 0.000 seconds (ie too faster for the program)
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  7. #27
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    No, it's more for the best code. I just was trying my hand at some Java. So, it ended up running quite quickly
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  8. #28

    Default Re: Counting

    Au Contraire Indy, it is very much a do-something machine. It works as described. Heres another one that counts from 0000 to 9999, and prints the numbers.

    Code:
    +T+++++++++++++++++++++++++++++++++++++++++++++++>
    ++H++++++++++++++++++++++++++++++++++++++++++++++>
    +++I+++++++++++++++++++++++++++++++++++++++++++++>
    ++++S++++++++++++++++++++++++++++++++++++++++++++>
    ++++++++++++++++++++++++++++++++<
    ------P----------------------------------------------------[
    +++++++R+++++++++++++++++++C++++++++++++++++++++++++++++++++
    <-------O-----------------O----------------------------------[
    +++++++++G+++++++++++++++U++++++++++++++++++++++++++++++++++
    <---------R-------------N------------------------------------
    [++++++++++A+++++++++++T+++++++++++++++++++++++++++++++++++++
    <-----------M---------S--------------------------------------
    [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    >>>.<.<.<.>>>>.<<<<
    ---------------T----------S----T---------S-------------------
    ]+++++++++++++O++++++++++T++++++H+++++++R++++++++++++>
    ----------------9-------N--------E-----E---------------------
    ]++++++++++++++9+++++++I++++++++++++++B+++++++++++++>
    --------------9---D---R--------------M-----------------------
    ]++++++++++++9+++N+++P++++++++++++++U++++++++++++++++>
    ----------------A------------------N-----------------------]

    And by the way, I think there is a +rep in order for whoever figures out which language my last two programs were written in...


    But I think I'll stop now, I don't want to hijack this thread too much
    Last edited by weazel6265; 04-06-2008 at 10:49 AM. Reason: Had to change code so it isn't interpreted as HTML tags
    I'm not creative enough to think of a funny sig. Just quietly laugh to yourself and I'll be happy.

  9. #29
    Overclocking Guru Trace's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    2,077

    Default Re: Counting

    Is it assembly?
    Quote Originally Posted by Lothair View Post
    I guess it's just widely used and has had some of the best people in the world work on it, costing a ridiculous amount of money, for no actual reason. :/
    Have you checked out the front page lately?
    Projects:
    Moe's Tavern | Sponsored by: Mimo Monitors, Crucial, Thermaltake
    Book Of Knowledge

  10. #30
    Resident EE mtekk's Avatar
    Join Date
    Dec 2007
    Location
    Minnesota
    Posts
    469

    Default Re: Counting

    Quote Originally Posted by crenn View Post
    If we're going to talk about letting the compilers to optimize, 0 to 10,000,000,000 in 0.000 seconds (ie too faster for the program)
    Well not exactly true. It's too fast for the resolution of the timer that you are using, so in theory there are some digits that are less than 10^-3 in cumulative value.

    I wonder if the x86 architecture has programmable hardware timers that can be configured like the PIC does...
    Quote Originally Posted by xRyokenx View Post
    ...I'm getting tired of not being able to figure this crap out because it's apparently made for computer-illiterate people by computer-illiterate people. lol

Posting Permissions

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