Q:

What's the unit of measurement for weapon range?

How is range measured in D&D 5e? Is it by feet, like the movement speed, is it squares, like 4e, or something else entirely? I'm asking to calculate the range of a rifle.

A:

Ranges in the core rulebooks are listed in feet. In fact, squares are not used in D&D 5E at all, except in the optional grid rules presented in the Dungeon Master's Guide (one square = five feet).
That said, there are rules for firearms (including rifles) on page 268 of the Dungeon Master's Guide.

A:

It's measured in feet. For example in the PHB a short bow has a normal range of 80ft and a long range of 320ft. if you're using a gridded map than usually its one square = 5ft
But as far as I know the range is always in feet.

A:

The spells and weapons in D&D 5e's rules show their range in feet: not squares, not hexes.  That suggests to me that the game's authors intended to go back to the convention that requires neither grids nor hexes. 
I'd recommend that you use polar coordinates: range for firearms and artillery is often judged in azimuth and distance.
Experience:
We used the same convention for range and direction in our D&D games as we used in our micro armor games, back in the day. (uh, starting 40 or so years ago and moving forward).  What we liked about it is that it freed us from hexes and squares on board games, which are an artificiality that is used to make a board game playable. 
Our most recent D&D group used Roll20 and our DM was happy to let us use polar coordinates to figure out range (distance and direction) even though he had grid squares up for ease of keeping track of position during play.  It worked very well. 
A piece of string and a ruler is the simplest mundane tool, if needed. 
Interestingly, some early computer games based on RPG's used squares (such as Diabo I) but as computing power grew it switched to an approximation of polar coordinates (see Diablo II and III). It's more "realistic" that way. 

