Long tap on the screen

i want to implement the long tap on the screen…If the user long taps on the screen the position of the x and y axis decreases and as soon as he releases the tap the x increases and the y decreases> i have messed around with somethings but no luck…heres the code i have been trying.

public class move : MonoBehaviour {
	public Vector2 velocity = new Vector2(40,40);
	public float forwardspeed=0.02f;
	Vector2 movement;
	// Use this for initialization
	void Start () {
		Debug.Log("start+"+Input.touchCount);

		movement.x+=(forwardspeed);
		movement.y-=(forwardspeed);
		rigidbody2D.velocity = movement;
	}
	
	// Update is called once per frame
	void FixedUpdate () {
		int i=0;
		while (i < Input.touchCount)
	   {
			// Is this the beginning phase of the touch?
			if (Input.GetTouch(i).phase == TouchPhase.Began)
			{
			Debug.Log("input touch count"+Input.touchCount);
			//	rigidbody2D.gravityScale =0;
				movement.x+=(forwardspeed);
				movement.y+=(forwardspeed);
				rigidbody2D.velocity = movement;
			}
			else if (Input.GetTouch(i).phase == TouchPhase.Ended)
		{	
				movement.x+=(forwardspeed);
				movement.y-=(forwardspeed);
				rigidbody2D.velocity = movement;
		}
			++i;
		}


	
	}
}

Didn’t tried but should work:

if (Input.GetTouch(i).phase == TouchPhase.Began)
		{
			startTime = Time.time;
		}

		if(Input.touchCount > 0 && startTime - Time.time > timer)
		{
			//Long tap stuff
			longTap = true;
		}

		if (Input.GetTouch(i).phase == TouchPhase.Ended && longTap)
		{
			longTap = false;
			//Long tap end stuff
		}

Here is a simple script. I think this should work fine.

private float forwardspeed;

void Start () {
    forwardspeed = 1.5f;
}
void FixedUpdate () {
    
    if (Input.GetMouseButtonDown (0)) {
    			mouseClicked = true;	
    }
    if (Input.GetMouseButtonUp (0)) {
    			mouseClicked = false;	
    }
    if (mouseClicked) {
    	rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x + Time.deltaTime * forwardspeed, rigidbody2D.velocity.y + Time.deltaTime * forwardspeed);
    		}
    else{
    	rigidbody2D.velocity = new Vector2(rigidbody2D.velocity.x + Time.deltaTime * forwardspeed, rigidbody2D.velocity.y - Time.deltaTime * forwardspeed);
    	}
    }