input: Write a python function to create a simple clock using the curses library.
  assert isinstance(main, object)
  assert callable(main)
output: import curses
  import time
  
  def main(stdscr):
      curses.curs_set(0)
      stdscr.nodelay(1)
      stdscr.timeout(1000)
  
      while True:
          stdscr.clear()
          height, width = stdscr.getmaxyx()
          current_time = time.strftime('%H:%M:%S')
          x = width // 2 - len(current_time) // 2
          y = height // 2
          stdscr.addstr(y, x, current_time)
          stdscr.refresh()
          
          key = stdscr.getch()
          if key != -1:
              break