How to set max execution timeout for statement like insert

Application environment:

Local development environment

TiDB version:

pingcap/tidb:v8.2.0

Reproduction method:

NA

Problem:

It was mentioned in the doc that after v6.4.0 max_execution_time will only be applicable for read only statements.

I want to know how can we timeout queries like insert or delete which exceed a certain threshold

Resource allocation:

NA

Attachment:

NA