How can I get the id of cpu(core) the current thread is running on?

Thank you