<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bench(image, thread_count):
 """Encode `image` to PNG on `thread_count` threads in parallel. Returns: A `float` representing number of seconds that it takes all threads to finish encoding `image`. """

  threads = [threading.Thread(target=lambda: encoder.encode_png(image))
             for _ in xrange(thread_count)]
  start_time = datetime.datetime.now()
  for thread in threads:
    thread.start()
  for thread in threads:
    thread.join()
  end_time = datetime.datetime.now()
  delta = (end_time - start_time).total_seconds()
  return delta