Rep. Mark Sanford (R-S.C.) addresses the crowd during a town hall meeting in Hilton Head, S.C., on March 18, 2017. (Sean Rayford/Getty Images)

There are a number of reasons that elected officials offer their endorsements to other candidates. One is to boost those candidates before other candidates jump in, to help show strength that hopefully makes possible competitors rethink jumping into the race. Another is to boost fundraising; an endorsement often brings with it some sort of appeal to the endorsing candidate’s list of donors. A third is to goose enthusiasm. Right before Election Day, rolling out a big endorsement that will energize people could spur people to the polls who might not otherwise go.

You can see, then, that the utility of an endorsement depends on it happening far enough in advance of voting to serve the desired purpose. At least, the utility to the candidate. Another reason that elected officials endorse is to be able to say that it was their endorsement that made the difference — to be able to play kingmaker, in the parlance. If that’s your goal, when you endorse doesn’t really matter. You just need to get it in before polls close, in theory.

But not usually within three hours of polls closing. Enter President Trump.

Polls closed in South Carolina’s primaries at 7 p.m. Tuesday. That tweet was sent at 4:12 p.m., giving voters a robust 168 minutes to be influenced by Trump’s thinking on the subject.

Why he tweeted what he did when he did is one thing. But it raises a question: How many people who were likely to vote were still going to do so?

To assess this question, we need to know when most people vote. In South Carolina, there isn’t a real early-vote process, so most voting occurs on Election Day. As of last Thursday, about 39,000 absentee ballots had been issued, less than 10 percent of the total number of votes cast in the 2014 primaries.

The question then becomes when on Election Day people vote. Or, more specifically, is it before or after 4 p.m.?

There have been studies on this question, as you might expect. In 1976, State University of New York at Stony Brook professor Ricardo Klorman released a study looking at when people voted, breaking down the data by occupation. His research was based on about 50,000 votes cast in 1972 and self-reported information about voting times.

Most people didn’t vote before 8 a.m. The most popular block in Klorman’s data was between 4 p.m. and 6 p.m. About 43 percent of voters cast ballots after 4 p.m. — although this includes localities where voting continued until 8 p.m.

There were some interesting variations by occupation. Farmers and salespeople voted in the morning. Laborers and professionals voted in the late afternoon.

That was 1972, though. It’s probably safer to look at data collected in California in 2008, part of a study from researchers from the University of California at Berkeley and Pew Center on the States. Released in 2012, it included a graph of voter arrivals in three observed counties in the northern part of the state.

California polls close at 8 p.m. There was a small bump in voting shortly after polls opened and a larger one about two hours before polls closed. It’s not clear whether that late-afternoon bump happened at 6 p.m. because it was two hours before polls closed or if it was because it was after work was over. If it’s the former, the equivalent bump in South Carolina would happen at around 5 p.m., meaning that more people might have voted before Trump’s tweet than would have been the case if polls remained open until 8 p.m. in the state.

It suggests, too, that Trump’s tweet was at least timed fairly well for hitting a decent chunk of the electorate in South Carolina. But there’s another consideration that’s important to note: How many voters actually saw the tweet?

Last month, FiveThirtyEight noted a poll from Gallup which found that about half of Americans see, read or hear “a lot” about Trump’s tweets. But only 4 percent of Americans have a Twitter account, follow Trump and read the majority of his tweets.

That’s nationally, not necessarily in South Carolina. What’s more, not all of those Trump-Twitter followers are going to vote in the Republican primary: Many would be Democrats. While half the country is aware of Trump’s tweets, that’s over the long term, including media coverage such as this article. Many people will only find out about Trump’s last-minute endorsement hours after he offered it, including some South Carolina voters.

The primary response of Trump’s tweet, then, will likely be felt Wednesday, after the results of the South Carolina primary are known. If Rep. Mark Sanford (R-S.C.) loses his primary, we will probably hear at some point this week that Trump’s last-minute tweet got the job done. If Sanford wins, we may never hear about the tweet again — at least from Trump.