summaryrefslogtreecommitdiff
path: root/source/base/base_platform.h
blob: 91cd55d3ab8795e19addb08a1ea379ca7fc19f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef BASE_PLATFORM_H
#define BASE_PLATFORM_H

#ifdef BASE_PLATFORM_IMPLEMENTATION
internal inline void
sleep_ms(long ms)
{
  struct timespec ts;
  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms % 1000) * 1000000L;

  while (nanosleep(&ts, &ts))
  {
    NULL;
  }
}
#endif /* BASE_PLATFORM_IMPLEMENTATION */
#endif /* BASE_PLATFORM_H */