Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor twinpictures

    (@twinpictures)

    How can we use milliseconds?

    Please provide more details.
    In setting the launch time, strtotime is used, so it would be simply a matter of adding the correct date and time format (see: Hour, minutes, seconds and fraction) like so:

    [tminus t="2018-11-11 11:11:11.1111"/]
    

    The countdown does not currently display milliseconds.

    Thread Starter scriptgeni

    (@scriptgeni)

    Hi I mean when adding this code to my page in only shows seconds countdown

    I want to have extra digits for milliseconds countdown

    2017 31/12 23:55 123 (milliseconds)

    Plugin Contributor twinpictures

    (@twinpictures)

    The plugin does not currently support this, be we can look into how much effort it would be to adding it. Can you provide more detail on your use case? How many positions would be required? Milliseconds are of course 1/1000th of a second, so logically this would be four digits… well, actually three: 999 – 000. Also, because of the speed, milliseconds would not be animated just the value would be updated in blur not really readable by most mammals.

    If it does not have to be exact, it might be easier just to add a animated gif that loops the milliseconds every second. Something like:
    https://www.motionelements.com/stock-video-2053060-countdown-timer-clock

    Thoughts?

    Update:
    One issue is that browsers can’t really handle manipulating the DOM every millisecond. Many browsers even set a minimum value for intervals around 10ms. The W3C suggests a minimum of 4ms:
    Sources:
    https://stackoverflow.com/questions/7648557/setinterval-behaviour-with-0-milliseconds-in-javascript

    Timers can be nested; after five such nested timers, however, the interval is forced to be at least four milliseconds. This API does not guarantee that timers will run exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected.

    https://html.spec.whatwg.org/#timers

    Stopwatches only count at hundredths of a second, so this might be doable, but still would be quite a taxing on the CPU.

    Faking it with an animated gif seems to be the most streamlined approach.

    • This reply was modified 6 years, 10 months ago by twinpictures. Reason: added timer interval info and sources
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can we also use milliseconds?’ is closed to new replies.