| 791 | } |
| 792 | |
| 793 | int64_t HttpAsyncFileServer::Internal::getCurrentTimeMilliseconds() |
| 794 | { |
| 795 | #if SC_PLATFORM_WINDOWS |
| 796 | struct _timeb t; |
| 797 | _ftime_s(&t); |
| 798 | return static_cast<int64_t>(t.time) * 1000 + t.millitm; |
| 799 | #else |
| 800 | struct timespec nowTimeSpec; |
| 801 | clock_gettime(CLOCK_REALTIME, &nowTimeSpec); |
| 802 | constexpr int64_t nanosecondsToMilliseconds = 1000 * 1000; |
| 803 | constexpr int64_t roundingNanoseconds = nanosecondsToMilliseconds / 2; |
| 804 | return static_cast<int64_t>(nowTimeSpec.tv_sec) * 1000 + |
| 805 | (static_cast<int64_t>(nowTimeSpec.tv_nsec) + roundingNanoseconds) / nanosecondsToMilliseconds; |
| 806 | #endif |
| 807 | } |
| 808 | |
| 809 | Result HttpAsyncFileServer::Internal::formatHttpDate(int64_t millisecondsSinceEpoch, char* buffer, size_t bufferSize, |
| 810 | size_t& outLength) |
nothing calls this directly
no outgoing calls
no test coverage detected