Commit 4e35a0e4 authored by Jim Fulton's avatar Jim Fulton

Updated to use random rather than rand.

parent 7f2c4a94
from Sync import Synchronized from Sync import Synchronized
import thread import thread
from rand import rand from random import random
from time import sleep from time import sleep
...@@ -12,7 +12,7 @@ class P(Synchronized): ...@@ -12,7 +12,7 @@ class P(Synchronized):
def inc(self): def inc(self):
c=self.count c=self.count
sleep(rand()/327680.0) sleep(random())
self.count=self.count+1 self.count=self.count+1
return c,self.count return c,self.count
......
import ThreadLock, thread import ThreadLock, thread
from rand import rand from random import random
from time import sleep from time import sleep
from ExtensionClass import Base from ExtensionClass import Base
...@@ -30,7 +30,7 @@ class P(Base): ...@@ -30,7 +30,7 @@ class P(Base):
def inc(self): def inc(self):
c=self.count c=self.count
sleep(rand()/32768.0) sleep(random())
self.count=self.count+1 self.count=self.count+1
return c,self.count return c,self.count
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment