Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Where is ticks_diff()?

    Scheduled Pinned Locked Moved LoPy
    5 Posts 4 Posters 1.3k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bmarkusB Offline
      bmarkus
      last edited by bmarkus

      Documention of utime module writes:

      Returns an increasing millisecond counter with arbitrary reference point, that wraps after some (unspecified) value. The value should be treated as opaque, suitable for use only with ticks_diff().

      but no ticks_diff() in utime.

      1 Reply Last reply Reply Quote 0
      • S Offline
        sakis
        last edited by

        Hi,

        Good point, ticks_diff() is not implemented yet since we are waiting for some features from Espressif before we can add it. We'll remove the reference from the docs and add it back once it's there.

        Sorry for the confusion.

        H 1 Reply Last reply Reply Quote 0
        • T Offline
          TravisT
          last edited by

          I also ran into this. Trying to make some periodic tasks found that hardware timers are not done and then found ticks_ms() and the reference to ticks_diff() but could not find anymore information.

          I do not think the reference needs to be removed from the documentation, but maybe a "*not implemented" note would be helpful.

          I am assuming this did not make it into the latest build (1.0.0.1?)

          1 Reply Last reply Reply Quote 0
          • H Offline
            HerbV @sakis
            last edited by

            @sakis

            What is the status with this. I've come to the same point. with missing "utime.ticks_add" and "utime.ticks_diff" it is quite useless to use ticks for calculating deatlines.

            Please go ahead, tx, Herbert

            bmarkusB 1 Reply Last reply Reply Quote 0
            • bmarkusB Offline
              bmarkus @HerbV
              last edited by bmarkus

              @herbv said in Where is ticks_diff()?:

              @sakis

              What is the status with this. I've come to the same point. with missing "utime.ticks_add" and "utime.ticks_diff" it is quite useless to use ticks for calculating deatlines.

              Please go ahead, tx, Herbert

              Well, if you can read ticks itself you can write your own ticks_diff. It takes time, memory, etc. but may work as 'Plan B'.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom