Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. how many seconds?

how many seconds?

Scheduled Pinned Locked Moved The Weird and The Wonderful
question
9 Posts 6 Posters 0 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    tommyligo
    wrote on last edited by
    #1

    (message found on a sharing file web site) "Download in NaN seconds" mmhh... maybe I try to download it tomorrow. :confused: I'm sorry that I have not the code, but you can try to guess it. Tommy

    M C P 3 Replies Last reply
    0
    • T tommyligo

      (message found on a sharing file web site) "Download in NaN seconds" mmhh... maybe I try to download it tomorrow. :confused: I'm sorry that I have not the code, but you can try to guess it. Tommy

      M Offline
      M Offline
      Megidolaon
      wrote on last edited by
      #2

      At least it doesn't produce an error or crash when trying to parse what's NaN...

      1 Reply Last reply
      0
      • T tommyligo

        (message found on a sharing file web site) "Download in NaN seconds" mmhh... maybe I try to download it tomorrow. :confused: I'm sorry that I have not the code, but you can try to guess it. Tommy

        C Offline
        C Offline
        CPallini
        wrote on last edited by
        #3

        Dealing with time produces funny horros, like the following one (found when I was in my former company):

        TotalSeconds = GetTotalSeconds();
        Seconds = 0;
        Minutes = 0;
        Hours = 0;

        for (i=0; i<TotalSeconds; i++)
        {
        Seconds++;
        if ( Seconds == 60)
        {
        Seconds = 0;
        Minutes++;
        if (Minutes == 60)
        {
        Minutes = 0;
        Hours++:
        }
        }
        }

        :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        R B 2 Replies Last reply
        0
        • C CPallini

          Dealing with time produces funny horros, like the following one (found when I was in my former company):

          TotalSeconds = GetTotalSeconds();
          Seconds = 0;
          Minutes = 0;
          Hours = 0;

          for (i=0; i<TotalSeconds; i++)
          {
          Seconds++;
          if ( Seconds == 60)
          {
          Seconds = 0;
          Minutes++;
          if (Minutes == 60)
          {
          Minutes = 0;
          Hours++:
          }
          }
          }

          :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          R Offline
          R Offline
          Robert C Cartaino
          wrote on last edited by
          #4

          CPallini wrote:

          long TotalMilliSeconds = gettime(); // number of milliseconds since September 1st, 1970.
          

          Ooo, I like that. Did your company receive a bug report about that "clock application" they wrote (I added the relevant code above in Red)? SPR: #8327 PROBLEM DESCRIPTION: My clock application takes 100% CPU and doesn't update every second. LIKELY CAUSE: long timespan = gettime(); **// number of milliseconds since September 1st, 1970.** SOLUTION: Your clock is running through 1,199,836,800,000 (1.2 trillion) iterations per second, you dumba**.

          C 1 Reply Last reply
          0
          • C CPallini

            Dealing with time produces funny horros, like the following one (found when I was in my former company):

            TotalSeconds = GetTotalSeconds();
            Seconds = 0;
            Minutes = 0;
            Hours = 0;

            for (i=0; i<TotalSeconds; i++)
            {
            Seconds++;
            if ( Seconds == 60)
            {
            Seconds = 0;
            Minutes++;
            if (Minutes == 60)
            {
            Minutes = 0;
            Hours++:
            }
            }
            }

            :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            B Offline
            B Offline
            BillW33
            wrote on last edited by
            #5

            Well, that would work, but it sure is the slow way of doing it :) Bill W

            C 1 Reply Last reply
            0
            • R Robert C Cartaino

              CPallini wrote:

              long TotalMilliSeconds = gettime(); // number of milliseconds since September 1st, 1970.
              

              Ooo, I like that. Did your company receive a bug report about that "clock application" they wrote (I added the relevant code above in Red)? SPR: #8327 PROBLEM DESCRIPTION: My clock application takes 100% CPU and doesn't update every second. LIKELY CAUSE: long timespan = gettime(); **// number of milliseconds since September 1st, 1970.** SOLUTION: Your clock is running through 1,199,836,800,000 (1.2 trillion) iterations per second, you dumba**.

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              :-D :laugh: :-D Sad to say (I don't like to shoot to the red cross) the authors came from VB world. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              1 Reply Last reply
              0
              • B BillW33

                Well, that would work, but it sure is the slow way of doing it :) Bill W

                C Offline
                C Offline
                CPallini
                wrote on last edited by
                #7

                Indeed it is working. The horror application is still alive. :-D

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                B 1 Reply Last reply
                0
                • T tommyligo

                  (message found on a sharing file web site) "Download in NaN seconds" mmhh... maybe I try to download it tomorrow. :confused: I'm sorry that I have not the code, but you can try to guess it. Tommy

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #8

                  It's so fast, the time is Not even a Number! :D (reminds me of that _other_ guy...)

                  Burning Chrome ^ | Linkify!| FoldWithUs! | sighist

                  1 Reply Last reply
                  0
                  • C CPallini

                    Indeed it is working. The horror application is still alive. :-D

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    B Offline
                    B Offline
                    BillW33
                    wrote on last edited by
                    #9

                    I understand that not everyone can be an expert at higher math, but that is really bad. Bill W

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups