Get an unsigned int milliseconds out of chrono::duration

Viewed 39370

For a winapi wrapper I want to use chrono for a duration given to the call. The code example:

bool setTimer(std::chrono::duration<std::chrono::milliseconds> duration)
{
    unsigned int dwDuration = Do some chrono magic here

    SetTimer(m_hWnd,1,dwDuration,0);
}

dwDuration has to be in milliseconds.

First question: How do to the magic.

Second question: Is the parameter declaration okay?

2 Answers
Related