Also hier bringt printf doch einiges....
Code: Alles auswählen
Global _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8
Threaded *__Result
*__Result = AllocateMemory(4096)
Macro Printf(Result, sFormat, _arg1, _arg2=_arg2, _arg3=_arg3, _arg4=_arg4, _arg5=_arg5, _arg6=_arg6, _arg7=_arg7, _arg8=_arg8)
	CompilerSelect #PB_Compiler_OS
	CompilerCase #PB_OS_Windows
		ImportC ""
			CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
				__Printf_#MacroExpandedCount(*pResult, nBytes, sFMT.p-UTF8, sBugfix.s, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) As "_snprintf"
			CompilerElse
				__Printf_#MacroExpandedCount(*pResult, nBytes, sFMT.p-UTF8, sBugfix.s, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) As "__snprintf"
			CompilerEndIf
		EndImport
	CompilerCase #PB_OS_MacOS
		ImportC ""
			__Printf_#MacroExpandedCount(*pResult, nBytes, sFMT.p-UTF8, sBugfix.s, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) As "_snprintf"
		EndImport
	CompilerCase #PB_OS_Linux
		ImportC ""
			__Printf_#MacroExpandedCount(*pResult, nBytes, sFMT.p-UTF8, sBugfix.s, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) As "snprintf"
		EndImport
	CompilerEndSelect
	__Printf_#MacroExpandedCount(*__Result, MemorySize(*__Result) - 1, "%s" + sFormat, #Empty$, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8)
	Result = PeekS(*__Result, -1, #PB_UTF8)
EndMacro
text.s
t1.s
t2.s
sComma.s=","
#iSaveDataNbDecimal=14
#sChar0="0"
EndOfLine.s=#CRLF$
iCount=1
rPoint1=2
rPointTime1.d=1/7
t-ElapsedMilliseconds()
For i=0 To 999999
	;Text = StrD(rPointTime1, #iSaveDataNbDecimal)
	;Text = RTrim(StrD(rPointTime1, #iSaveDataNbDecimal),#sChar0)
	;Text = Str(iCount) + sComma + RTrim(StrD(rPointTime1, #iSaveDataNbDecimal), #sChar0) + sComma + StrD(rPoint1) + EndOfLine
	;t1= Str(rPointTime1)
	;t2=sComma + StrD(rPoint1) + EndOfLine
	;Text = Str(iCount) + sComma + t1 + t2
	;Printf(Text,"%i,%.16f,%i",rPoint1,rPointTime1.d,iCount.i)
	Printf(Text,"%.16f",rPointTime1.d)
	Text=	Str(rPointTime1)+sComma + RTrim(Text,#sChar0) +sComma+ Str(rPointTime1)+EndOfLine
	;Text = Str(iCount) + sComma + RTrim(Str(rPointTime1), #sChar0) + sComma + StrD(rPoint1) + EndOfLine
Next i
t+ElapsedMilliseconds()
MessageRequester(Text,Str(t)+"ms")