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. This is the kind of productivity you get when you pay by lines of code

This is the kind of productivity you get when you pay by lines of code

Scheduled Pinned Locked Moved The Weird and The Wonderful
tools
8 Posts 8 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.
  • R Offline
    R Offline
    Rob Grainger
    wrote on last edited by
    #1

    '*******************************************************************
    '* This puts an application thread to sleep (millisecond)
    '*******************************************************************
    Function GotoSleep(Milliseconds As Long)
    Sleep (Milliseconds)
    End Function

    A B F T W 5 Replies Last reply
    0
    • R Rob Grainger

      '*******************************************************************
      '* This puts an application thread to sleep (millisecond)
      '*******************************************************************
      Function GotoSleep(Milliseconds As Long)
      Sleep (Milliseconds)
      End Function

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      I say this developer had brilliant foresight and should be given both a raise and a promotion! They must have known that VB's built-in functions would be transitioned to the .Net Framework at some point. Now, they only have to change a single line of code to make sure their entire code base uses System.Threading.Thread.Sleep(). They have also created a function rather than a sub, a clever trick in case they ever decide to return a value (e.g., a bool indicating whether or not the sleep operation was successful). Ingenious!

      Thou mewling ill-breeding pignut!

      Sander RosselS OriginalGriffO 2 Replies Last reply
      0
      • A AspDotNetDev

        I say this developer had brilliant foresight and should be given both a raise and a promotion! They must have known that VB's built-in functions would be transitioned to the .Net Framework at some point. Now, they only have to change a single line of code to make sure their entire code base uses System.Threading.Thread.Sleep(). They have also created a function rather than a sub, a clever trick in case they ever decide to return a value (e.g., a bool indicating whether or not the sleep operation was successful). Ingenious!

        Thou mewling ill-breeding pignut!

        Sander RosselS Offline
        Sander RosselS Offline
        Sander Rossel
        wrote on last edited by
        #3

        Not to mention the magnificent documentation this programmer provided! It's better documented than most code I know :)

        It's an OO world.

        public class Naerling : Lazy<Person>{
        public void DoWork(){ throw new NotImplementedException(); }
        }

        1 Reply Last reply
        0
        • A AspDotNetDev

          I say this developer had brilliant foresight and should be given both a raise and a promotion! They must have known that VB's built-in functions would be transitioned to the .Net Framework at some point. Now, they only have to change a single line of code to make sure their entire code base uses System.Threading.Thread.Sleep(). They have also created a function rather than a sub, a clever trick in case they ever decide to return a value (e.g., a bool indicating whether or not the sleep operation was successful). Ingenious!

          Thou mewling ill-breeding pignut!

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Surely, they should return the value while the thread is asleep, and stop returning it when it wakes up? ;)

          If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • R Rob Grainger

            '*******************************************************************
            '* This puts an application thread to sleep (millisecond)
            '*******************************************************************
            Function GotoSleep(Milliseconds As Long)
            Sleep (Milliseconds)
            End Function

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            Just a little change will allow for multi-threaded sleeping, i.e. create a new thread which does the sleep thus not blocking the main application :) . Imagine you'd have to do that when you used the built-in function everywhere...

            1 Reply Last reply
            0
            • R Rob Grainger

              '*******************************************************************
              '* This puts an application thread to sleep (millisecond)
              '*******************************************************************
              Function GotoSleep(Milliseconds As Long)
              Sleep (Milliseconds)
              End Function

              F Offline
              F Offline
              fjdiewornncalwe
              wrote on last edited by
              #6

              And he even included a "Goto" in there somehow. Awesome.

              I wasn't, now I am, then I won't be anymore.

              1 Reply Last reply
              0
              • R Rob Grainger

                '*******************************************************************
                '* This puts an application thread to sleep (millisecond)
                '*******************************************************************
                Function GotoSleep(Milliseconds As Long)
                Sleep (Milliseconds)
                End Function

                T Offline
                T Offline
                Thomas Daniels
                wrote on last edited by
                #7

                This is another kind of productivity you get when you pay by lines of code:

                ''' ''' This puts an application thread to sleep (millisecond)
                '''
                '''
                ''' The count of milliseconds
                '''
                Function GotoSleep(Milliseconds As Long)
                Sleep (Milliseconds)
                End Function

                In some cases, my signature will be longer than my message...

                <em style="color:red"> <b>ProgramFOX</b></em>

                ProgramFOX

                1 Reply Last reply
                0
                • R Rob Grainger

                  '*******************************************************************
                  '* This puts an application thread to sleep (millisecond)
                  '*******************************************************************
                  Function GotoSleep(Milliseconds As Long)
                  Sleep (Milliseconds)
                  End Function

                  W Offline
                  W Offline
                  wout de zeeuw
                  wrote on last edited by
                  #8

                  You get VB? :-D

                  Wout

                  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