code: def do_operation(database, keys, table, operation, latencies_ms):
      
      key = random.choice(keys)
      start = timeit.default_timer()
      if operation == 'read':
          read(database, table, key)
      elif operation == 'update':
          update(database, table,  key)
      else:
          raise ValueError('Unknown operation: %s' % operation)
      end = timeit.default_timer()
      latencies_ms[operation].append((end - start) * 1000)
docs: Does a single operation and records latency.