JavaScript Tip: Tracking Elapsed Time

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ม.ค. 2025

ความคิดเห็น • 13

  • @umangternate
    @umangternate 2 ปีที่แล้ว

    Thank you for the tutorial. Can we apply it when users move to other page? I am creating a small app for training. I want it to get the initial time (entry time) and then create the exit time and send repot to backend then open the page that the user was heading to.

    • @AllThingsJavaScript
      @AllThingsJavaScript  2 ปีที่แล้ว

      You can try the onbeforeunload event for the body tag. See if that will work for you to figure the time on page.

  • @creativedev3921
    @creativedev3921 3 ปีที่แล้ว +1

    Is there any way to findout system on time in between the certain timeslot,like morning 9’o clock to evening 4’o clock

    • @AllThingsJavaScript
      @AllThingsJavaScript  3 ปีที่แล้ว

      I'm not sure I understand what you are trying to do? How is your question different from get the time between two events?

  • @sriharsha1150
    @sriharsha1150 5 ปีที่แล้ว +1

    const tick = Date.now();
    const log = (v) => console.log(`${v}
    Elapsed: ${Date.now() - tick}`);
    We can just add this to find time elapsed

  • @renteflien
    @renteflien 5 ปีที่แล้ว

    Can you help me develop a script where I can calculate elapsed time?

    • @AllThingsJavaScript
      @AllThingsJavaScript  5 ปีที่แล้ว

      If you need some consulting services you can contact me at shancock@allthingsjavascript.com

  • @chchan8977
    @chchan8977 5 ปีที่แล้ว

    Hi can you show how to pass the elapsed time to another page and display it?

    • @divani382
      @divani382 5 ปีที่แล้ว

      probably with document get element byid ('id of div u want the text in').ineerhtml=eclapsedtime variable

  • @dynamics
    @dynamics 5 ปีที่แล้ว

    What theme is that? It's beautiful!

    • @AllThingsJavaScript
      @AllThingsJavaScript  5 ปีที่แล้ว +1

      Solarized (light) color scheme

    • @dynamics
      @dynamics 5 ปีที่แล้ว

      ​@@AllThingsJavaScript Thank you so much! 💛🌟🙏🏻 Am super grateful for your channel - I love your videos and am excited to dive deeper. Thank you for helping us students learn! 😊💗 💛

  • @jimmyfreckles4582
    @jimmyfreckles4582 ปีที่แล้ว

    See you soon bch