How would I slow down spinning toward the mouse?

Right now I have it where my character immediately follows the mouse and I wanted to know if you could put a delay on it somehow and make it slow down. It is also a 2D object. If you know how to do this, I would greatly appreciate it if you could help. Thanks!

	if (Time.timeScale == 1) {
		Vector3 mousePos = Input.mousePosition;
		mousePos.z = 0f;
		
		Vector3 objectPos = Camera.main.WorldToScreenPoint (transform.position);
		mousePos.x = mousePos.x - objectPos.x;
		mousePos.y = mousePos.y - objectPos.y;
		
		float angle = Mathf.Atan2 (mousePos.y, mousePos.x) * Mathf.Rad2Deg;
		transform.rotation = Quaternion.Euler (new Vector3 (0, 0, angle));
	}

Replace line 10 by:

Quaternion qTo = Quaternion.Euler (new Vector3 (0, 0, angle));
transform.rotation = Quaternion.RotateTowards(transform.rotation, qTo, speed * Time.deltaTime);

Where ‘speed’ is a variable you define and assign the degrees per second you want to allow.