I think here is your answer. Straight from the IMSA rules.
ARTICLE 49 – CONCLUSION OF RACE
49. CONCLUSION OF RACE
49.1. Once the duration of the Race expires or when the distance to cover is achieved, the pit exit is
closed and the checkered flag is displayed to the Car running first in the overall scoring order as it
crosses the finish line on the racetrack. If the Car shown first in the overall scoring order has not
crossed the finish line on the racetrack once the duration of the Race expires or when the distance
to cover has been achieved, the checkered flag is displayed when the next highest placed Car
crosses the finish line on the racetrack.
2019 IMSA SPORTING REGULATIONS & SERIES SUPPLEMENTARY REGULATIONS for the IMSA WEATHERTECH SPORTSCAR CHAMPIONSHIP
49.1.1. In Races of a given distance, the checkered flag is given first to the leading Car, then to the
other finishers as they cross the finish line.
49.1.2. In Races of a timed length, the checkered flag is given first to the leading Car as it crosses
the finish line at or after the expiration of the specified duration, then to the other finishers as
they cross the finish line.
A. If the leading Car is not running at the expiration of the time limit, the checkered flag is
displayed to the next highest running Car (not necessarily the winner) in the same
manner. If the leading Car is disabled at the expiration of the time limit, the Race Director
shall determine the time permitted for such Car to complete the final lap prior to the
display of the checkered flag.
49.1.3. Should the checkered flag be inadvertently or otherwise displayed before the leading Car
completes the scheduled number of laps or before the prescribed time has been completed,
the Race is nevertheless deemed ended when the flag is displayed.
49.1.4. Should the checkered flag be inadvertently delayed, the results are based on the positions
at the moment provided for in the scheduled Race length or distance. If the delayed checkered
flag is inadvertently or otherwise displayed to a Car other than the leader, it is considered a
delayed finish as though the flag had been given to the leader.
49.1.5. The checkered flag is displayed for a maximum of five (5) minutes.
49.1.6. It is not required to take the checkered flag on the racetrack to be eligible for a finishing
position, championship points and/or Point Fund / Prize Money.
49.1.7. To be listed as “running” in the results, the Car must cross the finish line on the racetrack
when the checkered flag is displayed except in case of “force majeure” at the Race Director’s
49.1.8. Cars are ordered in the results according to the number of whole laps completed during the
Race subject to any penalties applied. For Cars completing the same number of laps, the time
when the Cars cross the finish line determines the order.