1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    SysUtils.h
11 /// @author  Daniel Krajzewicz
12 /// @date    Fri, 29.04.2005
13 /// @version $Id$
14 ///
15 // A few system-specific functions
16 /****************************************************************************/
17 #ifndef SysUtils_h
18 #define SysUtils_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include <string>
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
30 /** @class SysUtils
31  * @brief A few system-specific functions
32  */
33 class SysUtils {
34 public:
35     /** @brief Returns the current time in milliseconds
36      * @return Current time
37      */
38     static long getCurrentMillis();
39 
40 
41 #ifdef _MSC_VER
42     /** @brief Returns the CPU ticks (windows only)
43      *
44      * Used for random number initialisation, linux version
45      *  uses a different method
46      */
47     static long getWindowsTicks();
48 #endif
49 
50 
51     /// @brief run a shell command without popping up any windows (particuarly on win32)
52     static unsigned long runHiddenCommand(const std::string& cmd);
53 };
54 
55 #endif
56 
57 /****************************************************************************/
58 
59