---
name: "std::this_thread"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::this_thread/3cxx"
---

# std::this\_thread(3cxx)

ISO C++ 2011 namespace for interacting with the current thread.

## NAME

std::this\_thread - ISO C++ 2011 namespace for interacting with the current thread.

## SYNOPSIS

### Functions

**thread::id** **get\_id** () noexcept\
 The unique identifier of the current thread.  template\<**typename** \_Rep , **typename** **\_Period** \> **void** **sleep\_for** (const **chrono::duration**\< \_Rep, **\_Period** \> &**\_\_rtime**)\
 this\_thread::sleep\_for  template\<**typename** **\_Clock** , **typename** **\_Duration** \> **void** **sleep\_until** (const **chrono::time\_point**\< **\_Clock**, **\_Duration** \> &**\_\_atime**)\
 this\_thread::sleep\_until  **void** **yield** () noexcept\
 Allow the implementation to schedule a different thread.

## Detailed Description

ISO C++ 2011 namespace for interacting with the current thread.

C++11 30.3.2 \[thread.thread.this\] Namespace this\_thread.

## Function Documentation

### thread::id std::this\_thread::get\_id ()` [inline]`, ` [noexcept]`

The unique identifier of the current thread.

### template\<typename \_Rep , typename \_Period \> void std::this\_thread::sleep\_for (const chrono::duration\< \_Rep, \_Period \> & \_\_rtime)` [inline]`

this\_thread::sleep\_for

Referenced by **sleep\_until()**.

### template\<typename \_Clock , typename \_Duration \> void std::this\_thread::sleep\_until (const chrono::time\_point\< \_Clock, \_Duration \> & \_\_atime)` [inline]`

this\_thread::sleep\_until

References **sleep\_for()**.

### void std::this\_thread::yield ()` [inline]`, ` [noexcept]`

Allow the implementation to schedule a different thread.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
