

# Track events in Managed Service for Apache Flink using the DataStream API
<a name="how-time"></a>

Managed Service for Apache Flink tracks events using the following timestamps:
+ **Processing Time:** Refers to the system time of the machine that is executing the respective operation.
+ **Event Time:** Refers to the time that each individual event occurred on its producing device.
+ **Ingestion Time:** Refers to the time that events enter the Managed Service for Apache Flink service.

You set the time used by the streaming environment using `setStreamTimeCharacteristic`. 

```
env.setStreamTimeCharacteristic(TimeCharacteristic.ProcessingTime);
env.setStreamTimeCharacteristic(TimeCharacteristic.IngestionTime);
env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);
```

For more information about timestamps, see [Generating Watermarks](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/dev/datastream/event-time/generating_watermarks/) in the Apache Flink documentation.