> For the complete documentation index, see [llms.txt](https://www.learnros2.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.learnros2.com/ros/cookbook.md).

# Cookbook

## How to set up timer for periodic tasks?

`rclcpp:rclcpp::Node` class has a method called `create_wall_timer`, which can be used to create period signal. The following two c++ functions are usually used with the `create_wall_timer` method.

* [std::bind](https://en.cppreference.com/w/cpp/utility/functional/bind)
* [std::placeholders::\_1](https://en.cppreference.com/w/cpp/utility/functional/placeholders)

## How to get the current time?

If we are inside a node, we can use the following code to get the current time.

```
this->get_clock()->now()
```
