File: setalarm.cc

package info (click to toggle)
bobcat 6.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,960 kB
  • sloc: cpp: 18,954; fortran: 5,617; makefile: 2,787; sh: 659; perl: 401; ansic: 26
file content (11 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
#include "selector.ih"

void Selector::setAlarm(int sec, int usec)
{
    d_alarm.tv_sec  = sec;
    d_alarm.tv_usec = usec;

    long long testTime = usec + 1000000LL * sec;
    if (testTime < 0 || testTime > numeric_limits<int>::max() * 1000000LL)
        throw Exception{1} << "Selector::setAlarm()";
}