how to detect the speed

how to detect the speed of an object from point A to point B without using rigidbody and wheel-collider… is there someone who can help me ? thx…

Speed = distance / time

Distance = B - A

You need three script one attached to Player. second to the collider at A and last for collider at B.

float dx=B.x-A.x;                   //inside player script
		float dy=B.y-A.y;
		float timeTaken;
		float distance;
		float speed;
		distance=Mathf.Sqrt(dx*dx+dy*dy);
		timeTaken=ColliderScriptB.timeAtB-colliderScriptA.timeAtA;
		speed=distance/time;

		public static float timeAtA;       // Attached to collider at A
		void OnColligenEnter (Collider obj) 
		{
			if(obj.gameObject.name=="PlayerObject")
			{
				timeAtA=Time.time;
			}
		}

		public static float timeAtB;   // Attached to collider at B
		void OnColligenEnter (Collider obj) 
		{
			if(obj.gameObject.name=="PlayerObject")
			{
				timeAtB=Time.time;
			}
		}

is this working or not let me know.