1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Skript time to java

Discussion in 'Java' started by Normalguy, Jul 12, 2018 at 3:50 AM.

  1. N

    Normalguy Well-Known Member

    Joined:
    Apr 19, 2018
    Messages:
    98
    Likes Received:
    0
    Hi, I want to set time like
    Code (Skript):
    1. Set (_now) to now
    In java. This isn’t my actual problem. My problem is how to get the difference between time. Like 0.05 seconds
     
  2. Best Answer:
    Post #2 by Donut, Jul 12, 2018 at 2:25 PM
  3. Donut

    Addon Developer

    Joined:
    Mar 27, 2017
    Messages:
    1,244
    Likes Received:
    144
    Medals:
    Code (Java):
    1. long timerStart = System.currentTimeMillis()
    2. later...
    3. long timeDifference = System.currentTimeMillis() - timerStart
    this will obviously be in milliseconds so if you want seconds divide by 1000
     
Loading...