TrinityCore
Loading...
Searching...
No Matches
GameTime.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GAMETIME_H
19#define __GAMETIME_H
20
21#include "Define.h"
22#include "Duration.h"
23
24namespace GameTime
25{
26 // Server start time
28
29 // Current server time (unix) in seconds
30 TC_GAME_API time_t GetGameTime();
31
32 // Milliseconds since server start
34
37
40
42 template<typename Clock>
43 typename Clock::time_point GetTime();
44
47
48 TC_GAME_API tm const* GetDateAndTime();
49
50 void UpdateGameTimers();
51}
52
53#endif
#define TC_GAME_API
Definition: Define.h:124
uint32_t uint32
Definition: Define.h:143
std::chrono::system_clock::time_point SystemTimePoint
Definition: Duration.h:42
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
Definition: Duration.h:41
Definition: GameTime.cpp:23
Clock::time_point GetTime()
Current chrono Clock time point.
Definition: GameTime.cpp:60
void UpdateGameTimers()
Definition: GameTime.cpp:87
SystemTimePoint GetSystemTime()
Current chrono system_clock time point.
Definition: GameTime.cpp:49
TimePoint Now()
Current chrono steady_clock time point.
Definition: GameTime.cpp:54
tm const * GetDateAndTime()
Definition: GameTime.cpp:82
time_t GetGameTime()
Definition: GameTime.cpp:39
time_t GetStartTime()
Definition: GameTime.cpp:34
uint32 GetUptime()
Uptime (in secs)
Definition: GameTime.cpp:77
uint32 GetGameTimeMS()
Definition: GameTime.cpp:44