Check if a method hasn't been used for one second

I want to create a health bar that when the creature hasn’t be hit for a second, its health bar will disappear. How can I do that?
Please use C# because I don’t really understand javascript.

bool _isEnabled;
float _timerDisappear;

private void Update()
{
    if (_isEnabled)
    {
        _timerDisappear += Time.deltaTime;
        if (_timerDisappear > 1.0f)
        {
            _healtBar.SetActive(false);
            _isEnabled = false;
        }
    }
}

private void WasHit()
{
    _healthBar.SetActive(true);
    _isEnabled = true;
    _timerDisappear = 0.0f;
}