How to check the current timeframe

 
What is a good example code of how to use ENUM_TIMEFRAME, PERIOD_CURRENT, Period() and _Period?
Can I check the timeframe of the current chat by writing the following?

if (Period() == ENUM_TIMEFRAME)
   Bla bla bla

or

if (ENUM_TIMEFRAME == PERIOD_CURRENT)
   Bla bla bla

Both examples are giving me error.
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. The first is equivalent to if(15 == int) babble.
  3. The second is equivalent to (if int == 0) babble.
  4. The current chart is always the current chart. What you are trying to test makes no sense.
  5. Period() and _Period are identical. Period_Current equals zero.
  6. Enumered lists - Indices - Expert Advisors and Automated Trading - MQL5 programming forum