[dataio] adding time sleep for performance
This commit is contained in:
parent
e4e86cbc49
commit
12e82dceee
@ -18,20 +18,19 @@ class NixWriter:
|
|||||||
chunk = 1000
|
chunk = 1000
|
||||||
log.debug("Starting the writing")
|
log.debug("Starting the writing")
|
||||||
self.write = True
|
self.write = True
|
||||||
|
|
||||||
total_count = self.buffer.totalcount()
|
|
||||||
while self.write:
|
while self.write:
|
||||||
|
total_count = self.buffer.totalcount()
|
||||||
if total_count - items >= chunk:
|
if total_count - items >= chunk:
|
||||||
log.debug(items)
|
# log.debug(items)
|
||||||
try:
|
try:
|
||||||
data, _ = self.buffer.read(items, extend=chunk)
|
data, _ = self.buffer.read(items, extend=chunk)
|
||||||
self.data_array.append(data)
|
self.data_array.append(data)
|
||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
time.sleep(0.01)
|
time.sleep(0.001)
|
||||||
log.debug(f"{e}")
|
log.debug(f"{e}")
|
||||||
items += chunk
|
items += chunk
|
||||||
else:
|
else:
|
||||||
time.sleep(0.01)
|
time.sleep(0.001)
|
||||||
continue
|
continue
|
||||||
log.debug("Stoppint the writing")
|
log.debug("Stoppint the writing")
|
||||||
log.debug(f"Samples written {items}")
|
log.debug(f"Samples written {items}")
|
||||||
|
Loading…
Reference in New Issue
Block a user