1 : /*
2 : * Copyright 2008 The Native Client Authors. All rights reserved.
3 : * Use of this source code is governed by a BSD-style license that can be
4 : * found in the LICENSE file.
5 : */
6 :
7 : /*
8 : * NaCl Server Runtime logging code.
9 : */
10 :
11 : #include "native_client/src/include/portability.h"
12 : #include <stdio.h>
13 : #include "windows.h"
14 :
15 : #include "native_client/src/shared/platform/nacl_timestamp.h"
16 :
17 : /*
18 : * TODO(bsy): split formatting from getting the time.
19 : */
20 : char *NaClTimeStampString(char *buffer,
21 7 : size_t buffer_size) {
22 : SYSTEMTIME systime;
23 :
24 7 : GetSystemTime(&systime);
25 :
26 : _snprintf_s(buffer, buffer_size, _TRUNCATE, "%02d:%02d:%02d.%06d",
27 : systime.wHour, systime.wMinute, systime.wSecond,
28 7 : systime.wMilliseconds*1000);
29 7 : return buffer;
30 7 : }
|