kbhit() will return a positive number each time it is called after you press any key. So in your loop in count() it will loop around returning 0 until you press a key when it will start returning a positive number. While you dont press a key the loop in main() loops around very fast giving the processor a hard time because counter1 is 0 until you press a key.
To fix this you should call getch() when kbhit() returns positive to clear the buffer before the next call to kbhit(), but the main thread will still loop around crazy until you have pressed 10 times and then counter2 will be some large (or wrapped) number.
Dont know why you create a thread or what you are really trying to do.