Time.sleep(0.0125) not available within Linux

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blubaugh, David A.

    Time.sleep(0.0125) not available within Linux

    To All,


    I was wondering if anyone has come across the issue of not being allowed
    to have the following within a Python script operating under Linux:

    time.sleep(0.01 25)

    It appears that I am not allowed to have the object sleep. Has anyone
    encountered this specific issue before in the past?


    Thank You,


    David Blubaugh







    This e-mail transmission contains information that is confidential and may be
    privileged. It is intended only for the addressee(s) named above. If you receive
    this e-mail in error, please do not read, copy or disseminate it in any manner.
    If you are not the intended recipient, any disclosure, copying, distribution or
    use of the contents of this information is prohibited. Please reply to the
    message immediately by informing the sender that the message was misdirected.
    After replying, please erase it from your computer system. Your assistance in
    correcting this error is appreciated.

  • Grant Edwards

    #2
    Re: Time.sleep(0.01 25) not available within Linux

    On 2008-09-23, Blubaugh, David A. <dblubaugh@belc an.comwrote:
    I was wondering if anyone has come across the issue of not being allowed
    to have the following within a Python script operating under Linux:
    >
    time.sleep(0.01 25)
    No, I have not. And I doubt anybody else has.
    It appears that I am not allowed to have the object sleep.
    It doesn't appear that way to me. Care to explain how you
    arrived at that conclusion?
    Has anyone encountered this specific issue before in the past?
    $ python
    Python 2.5.2 (r252:60911, Aug 28 2008, 15:54:48)
    [GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on linux2
    Type "help", "copyright" , "credits" or "license" for more
    information.
    >>import time
    >>time.sleep(0. 0125)
    >>>
    The above code has worked as far back as I can recall (which I
    think includes Python 1.4).

    --
    Grant

    Comment

    • Lawrence D'Oliveiro

      #3
      Re: Time.sleep(0.01 25) not available within Linux

      In message <__KdneWJPotDx0 XVnZ2dnUVZ_gGdn Z2d@posted.usin ternet>, Grant
      Edwards wrote:
      On 2008-09-23, Blubaugh, David A. <dblubaugh@belc an.comwrote:
      >
      >I was wondering if anyone has come across the issue of not being allowed
      >to have the following within a Python script operating under Linux:
      >>
      >time.sleep(0.0 125)
      >
      No, I have not. And I doubt anybody else has.
      Just a thought, your minimum sleep time is probably limited by the
      resolution of the system "HZ" clock. Type

      less /proc/config.gz

      and search for the value of the "CONFIG_HZ" setting. On the Athlon 64
      machine I'm using to write this, it's 250, which should allow for sleep
      intervals in multiples of 0.004 seconds.

      Comment

      • Steven D'Aprano

        #4
        Re: Time.sleep(0.01 25) not available within Linux

        On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
        Just a thought, your minimum sleep time is probably limited by the
        resolution of the system "HZ" clock. Type
        >
        less /proc/config.gz

        $ less /proc/config.gz
        /proc/config.gz: No such file or directory


        What OS are you using?



        --
        Steven

        Comment

        • Lawrence D'Oliveiro

          #5
          Re: Time.sleep(0.01 25) not available within Linux

          In message <00eb2560$0$206 66$c3e8da3@news .astraweb.com>, Steven D'Aprano
          wrote:
          On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
          >
          >Just a thought, your minimum sleep time is probably limited by the
          >resolution of the system "HZ" clock. Type
          >>
          > less /proc/config.gz
          >
          $ less /proc/config.gz
          /proc/config.gz: No such file or directory
          >
          >
          What OS are you using?
          The one named in the subject line?

          Comment

          • Steven D'Aprano

            #6
            Re: Time.sleep(0.01 25) not available within Linux

            On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote:
            In message <00eb2560$0$206 66$c3e8da3@news .astraweb.com>, Steven D'Aprano
            wrote:
            >
            >On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
            >>
            >>Just a thought, your minimum sleep time is probably limited by the
            >>resolution of the system "HZ" clock. Type
            >>>
            >> less /proc/config.gz
            >>
            >$ less /proc/config.gz
            >/proc/config.gz: No such file or directory
            >>
            >>
            >What OS are you using?
            >
            The one named in the subject line?
            Are you asking me or telling me?


            I've tried on five different Linux machines I have access to, and there
            is no such /proc/config.gz on any of them:

            two different versions of Centos
            two versions of Fedora
            one version of Ubuntu

            So let me rephrase my question... what *specific* OS are you using?



            --
            Steven

            Comment

            • Lawrence D'Oliveiro

              #7
              Re: Time.sleep(0.01 25) not available within Linux

              In message <pan.2008.09.26 .08.26.56@REMOV E.THIS.cybersou rce.com.au>, Steven
              D'Aprano wrote:
              On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote:
              >
              >In message <00eb2560$0$206 66$c3e8da3@news .astraweb.com>, Steven D'Aprano
              >wrote:
              >>
              >>On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
              >>>
              >>>Just a thought, your minimum sleep time is probably limited by the
              >>>resolution of the system "HZ" clock. Type
              >>>>
              >>> less /proc/config.gz
              >>>
              >>$ less /proc/config.gz
              >>/proc/config.gz: No such file or directory
              >>>
              >>>
              >>What OS are you using?
              >>
              >The one named in the subject line?
              >
              Are you asking me or telling me?
              >
              >
              I've tried on five different Linux machines I have access to, and there
              is no such /proc/config.gz on any of them:
              >
              two different versions of Centos
              two versions of Fedora
              one version of Ubuntu
              >
              So let me rephrase my question... what *specific* OS are you using?
              <http://lxr.linux.no/linux+v2.6.26.5/kernel/configs.c#L82>

              Comment

              • jkn

                #8
                Re: Time.sleep(0.01 25) not available within Linux

                On Sep 26, 9:26 am, Steven D'Aprano
                <ste...@REMOVE. THIS.cybersourc e.com.auwrote:
                On Fri, 26 Sep 2008 19:46:10 +1200, Lawrence D'Oliveiro wrote:
                In message <00eb2560$0$206 66$c3e8...@news .astraweb.com>, Steven D'Aprano
                wrote:
                >
                On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
                >
                >Just a thought, your minimum sleep time is probably limited by the
                >resolution of the system "HZ" clock. Type
                >
                > less /proc/config.gz
                >
                $ less /proc/config.gz
                /proc/config.gz: No such file or directory
                >
                What OS are you using?
                >
                The one named in the subject line?
                >
                Are you asking me or telling me?
                >
                I've tried on five different Linux machines I have access to, and there
                is no such /proc/config.gz on any of them:
                >
                /proc/config.gz is not directly connected with a specific linux
                distribution; it's a function of the kernel build configuration. If
                the appropriate setting is enabled, then /proc/config.gz will show
                (via eg. zcat) the equivalent of the .config file used to build the
                kernel you are actually running. It's a useful feature in all linuces,
                going back quite a way IIRC.

                J^n

                Comment

                • Grant Edwards

                  #9
                  Re: Time.sleep(0.01 25) not available within Linux

                  On 2008-09-26, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
                  In message <00eb2560$0$206 66$c3e8da3@news .astraweb.com>, Steven D'Aprano
                  wrote:
                  >
                  >On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
                  >>
                  >>Just a thought, your minimum sleep time is probably limited by the
                  >>resolution of the system "HZ" clock. Type
                  >>>
                  >> less /proc/config.gz
                  >>
                  >$ less /proc/config.gz
                  >/proc/config.gz: No such file or directory
                  >>
                  >>
                  >What OS are you using?
                  >
                  The one named in the subject line?
                  Never assume somebody reading the article and attempting to
                  help you can see the subject line.

                  --
                  Grant Edwards grante Yow! I'm encased in the
                  at lining of a pure pork
                  visi.com sausage!!

                  Comment

                  • Edel SM

                    #10
                    Re: Time.sleep(0.01 25) not available within Linux

                    helllo,

                    On Fri, Sep 26, 2008 at 3:46 PM, Lawrence D'Oliveiro
                    <ldo@geek-central.gen.new _zealandwrote:
                    In message <00eb2560$0$206 66$c3e8da3@news .astraweb.com>, Steven D'Aprano
                    wrote:
                    >
                    >On Wed, 24 Sep 2008 22:18:05 +1200, Lawrence D'Oliveiro wrote:
                    >>
                    >>Just a thought, your minimum sleep time is probably limited by the
                    >>resolution of the system "HZ" clock. Type
                    >>>
                    >> less /proc/config.gz
                    >>
                    >$ less /proc/config.gz
                    >/proc/config.gz: No such file or directory
                    >>
                    or: less /boot/config-`uname -r`


                    --
                    edel

                    Comment

                    • Lawrence D'Oliveiro

                      #11
                      Re: Time.sleep(0.01 25) not available within Linux

                      In message <Qtmdndz1gYzQnk DVnZ2dnUVZ_szin Z2d@posted.visi >, Grant Edwards
                      wrote:
                      Never assume somebody reading the article and attempting to
                      help you can see the subject line.
                      Why not?

                      Comment

                      • Grant Edwards

                        #12
                        Re: Time.sleep(0.01 25) not available within Linux

                        On 2008-09-26, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
                        In message <Qtmdndz1gYzQnk DVnZ2dnUVZ_szin Z2d@posted.visi >, Grant Edwards
                        wrote:
                        >
                        >Never assume somebody reading the article and attempting to
                        >help you can see the subject line.
                        >
                        Why not?
                        Because it might not be. It depends on the user's newsreader
                        and editor settings. Assuming the reader can't see the subject
                        line while reading the article has been one of the basic rules
                        of Usenet posting for decades. At least that's what I've
                        always been told: make sure the body of a posting contains
                        sufficient information to answer the question.

                        --
                        Grant

                        Comment

                        • Lawrence D'Oliveiro

                          #13
                          Re: Time.sleep(0.01 25) not available within Linux

                          In message <dZOdnT0NKORdEE DVnZ2dnUVZ_rvin Z2d@posted.usin ternet>, Grant
                          Edwards wrote:
                          On 2008-09-26, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealand>
                          wrote:
                          >In message <Qtmdndz1gYzQnk DVnZ2dnUVZ_szin Z2d@posted.visi >, Grant Edwards
                          >wrote:
                          >>
                          >>Never assume somebody reading the article and attempting to
                          >>help you can see the subject line.
                          >>
                          >Why not?
                          >
                          Because it might not be. It depends on the user's newsreader
                          and editor settings.
                          So, should I not assume that they can see the content as well, because it
                          might not be visible, depending on the user's newsreader and editor
                          settings?

                          Comment

                          • Grant Edwards

                            #14
                            Re: Time.sleep(0.01 25) not available within Linux

                            On 2008-09-27, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealandwrote:
                            In message <dZOdnT0NKORdEE DVnZ2dnUVZ_rvin Z2d@posted.usin ternet>, Grant
                            Edwards wrote:
                            >
                            >On 2008-09-26, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealand>
                            >wrote:
                            >>In message <Qtmdndz1gYzQnk DVnZ2dnUVZ_szin Z2d@posted.visi >, Grant Edwards
                            >>wrote:
                            >>>
                            >>>Never assume somebody reading the article and attempting to
                            >>>help you can see the subject line.
                            >>>
                            >>Why not?
                            >>
                            >Because it might not be. It depends on the user's newsreader
                            >and editor settings.
                            >
                            So, should I not assume that they can see the content as well,
                            because it might not be visible, depending on the user's
                            newsreader and editor settings?
                            Thats seems like a bit of reductio ad absurdum. My
                            observations over the years confirm the advice that you
                            shouldn't place information solely in the subject line. If you
                            rely on people re-reading the subject line as the read and
                            reply to the body of the posting, you'll often get bad results.
                            People will miss information that was left out of the body and
                            placed solely in the subject line. I've seen it happen over an
                            over again (this thread is an example).

                            If you don't care whether you get timely and accurate
                            responses, then do whatever you want. Otherwise, include all
                            the pertinent information in the body of the posting.

                            --
                            Grant

                            Comment

                            • Gabriel Genellina

                              #15
                              Re: Time.sleep(0.01 25) not available within Linux

                              En Sat, 27 Sep 2008 01:46:45 -0300, Lawrence D'Oliveiro
                              <ldo@geek-central.gen.new _zealandescribi รณ:
                              In message <dZOdnT0NKORdEE DVnZ2dnUVZ_rvin Z2d@posted.usin ternet>, Grant
                              Edwards wrote:
                              >On 2008-09-26, Lawrence D'Oliveiro <ldo@geek-central.gen.new _zealand>
                              >wrote:
                              >>In message <Qtmdndz1gYzQnk DVnZ2dnUVZ_szin Z2d@posted.visi >, Grant
                              >>Edwards wrote:
                              >>>
                              >>>Never assume somebody reading the article and attempting to
                              >>>help you can see the subject line.
                              >>>
                              >>Why not?
                              >>
                              >Because it might not be. It depends on the user's newsreader
                              >and editor settings.
                              >
                              So, should I not assume that they can see the content as well, because it
                              might not be visible, depending on the user's newsreader and editor
                              settings?
                              Of course not. But the space allowed for the subject line may be limited -
                              body usually wraps, but subject might not. Add a few Re: Rv: at the start
                              and even fewer characters are displayed.
                              I currently see the subject line shortened at: available wi...

                              --
                              Gabriel Genellina

                              Comment

                              Working...