Results 1 to 7 of 7
  1. #1
    linkxs is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default A weirdish clock program.

    Hey guys, I'm a beginner in java. I'm trying to figure out a way to make a clock, but not one that would call on the computer's clock. Is there a way for java to calculate it by itself?

    My end result would be a modified clock, where one second would be .84 of a second. I guess I could merely calculate it out of computer's clock, but if there's a way for my program to calculate time, I'd like it more.

    Thanks for your help! :)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: A weirdish clock program.

    Because most computers are multiprogrammed, you have to rely on the computer's clock. Your program has no easy way to determine if the OS has paused it for some time to run another program.

  3. #3
    linkxs is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Re: A weirdish clock program.

    Ok, but then is there a way to display modified time, as I said before, using shorter seconds?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: A weirdish clock program.

    You can take the real time and convert it to your modified time.

  5. #5
    linkxs is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Re: A weirdish clock program.

    Yeah, I just thought of a way to do it. Thanks for your help!

  6. #6
    linkxs is offline Member
    Join Date
    Sep 2011
    Posts
    9
    Rep Power
    0

    Default Re: A weirdish clock program.

    Actually, read help with clock , realized that there's a timer class: Timer (Java 2 Platform SE v1.4.2) . I could use that, no?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default Re: A weirdish clock program.

    You should try it and see if it does what you need.

Similar Threads

  1. 24 hour clock to 12 hour clock project.
    By bs3ac in forum New To Java
    Replies: 4
    Last Post: 01-08-2013, 10:10 AM
  2. clock
    By ws6driver in forum New To Java
    Replies: 1
    Last Post: 07-31-2009, 04:15 AM
  3. java clock
    By bugmenot in forum JCreator
    Replies: 0
    Last Post: 04-07-2009, 10:25 PM
  4. Need help with Java clock
    By adz666 in forum New To Java
    Replies: 1
    Last Post: 10-15-2008, 02:18 AM
  5. clock class program
    By jvasilj1 in forum New To Java
    Replies: 12
    Last Post: 02-01-2008, 08:27 PM

Posting Permissions

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